-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathesbuild.js
More file actions
34 lines (32 loc) · 754 Bytes
/
esbuild.js
File metadata and controls
34 lines (32 loc) · 754 Bytes
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
import * as esbuild from "esbuild";
import { sassPlugin } from "esbuild-sass-plugin";
const outdir = process.argv[2];
if (!outdir) {
console.error("Missing output directory argument");
process.exit(1);
}
await esbuild.build({
entryPoints: ["src/jg/coop/js/index.js", "src/jg/coop/css/index.scss"],
bundle: true,
minify: true,
sourcemap: true,
target: "es2020",
loader: {
".svg": "copy",
".jpg": "copy",
".png": "copy",
".webp": "copy",
".woff": "copy",
".woff2": "copy",
},
assetNames: "assets/[name]",
plugins: [
sassPlugin({
// async transform(source) {
// const { css } = await postcss([autoprefixer]).process(source);
// return css;
// },
}),
],
outdir,
});