-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.mjs
42 lines (39 loc) · 1.17 KB
/
build.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import esbuild from "esbuild";
import extensibilityMap from "@neos-project/neos-ui-extensibility/extensibilityMap.json" with { type: "json" };
import stylexPlugin from "@stylexjs/esbuild-plugin";
import path from "path";
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** @type {import("esbuild").BuildOptions} */
const options = {
logLevel: "info",
bundle: true,
minify: true,
sourcemap: false,
target: "es2020",
format: "iife",
legalComments: "none",
entryPoints: {
Plugin: "Resources/Private/Editor/manifest.js",
},
loader: {
".js": "tsx",
},
outdir: "Resources/Public",
alias: extensibilityMap,
plugins: [
stylexPlugin({
classNamePrefix: "newsletter-",
useCSSLayers: false,
dev: false,
generatedCSSFileName: path.resolve(__dirname, "Resources/Public/Plugin.css"),
stylexImports: ["@stylexjs/stylex"],
}),
],
};
// eslint-disable-next-line no-undef
if (process.argv.includes("--watch")) {
esbuild.context(options).then((ctx) => ctx.watch());
} else {
esbuild.build(options);
}