-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.mjs
37 lines (34 loc) · 1 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
import esbuild from "esbuild";
import extensibilityMap from "@neos-project/neos-ui-extensibility/extensibilityMap.json" assert { type: "json" };
import { cssModules } from "esbuild-plugin-lightningcss-modules";
/** @type {import("esbuild").BuildOptions} */
const options = {
logLevel: "info",
bundle: true,
minify: process.argv.includes("--production"),
sourcemap: true,
target: "es2020",
format: "iife",
legalComments: "none",
entryPoints: { Plugin: "Resources/Private/RangeEditor/manifest.js" },
loader: {
".js": "jsx",
},
outdir: "Resources/Public",
alias: extensibilityMap,
plugins: [
cssModules({
targets: {
chrome: 80, // aligns somewhat to es2020
},
cssModules: {
pattern: "carbon-rangeeditor-[hash]-[local]",
},
}),
],
};
if (process.argv.includes("--watch")) {
esbuild.context(options).then((ctx) => ctx.watch());
} else {
esbuild.build(options);
}