forked from fvtt-fria-ligan/forbidden-lands-foundry-vtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
esbuild.config.js
38 lines (36 loc) · 946 Bytes
/
esbuild.config.js
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
import { build } from "esbuild";
import { sassPlugin } from "esbuild-sass-plugin";
import templatePathsPromise from "./tools/get-template-paths.js";
const templatePaths = await templatePathsPromise;
export default ({ watch = false, production = false } = {}) =>
build({
bundle: true,
entryPoints: ["./src/forbidden-lands.js", "./src/forbidden-lands.scss"],
outdir: "dist",
format: "esm",
logLevel: "info",
sourcemap: !production ? "inline" : false,
ignoreAnnotations: !production,
minifyWhitespace: true,
minifySyntax: true,
drop: production ? ["console", "debugger"] : [],
define: {
GLOBALPATHS: JSON.stringify(templatePaths),
},
watch,
plugins: [
sassPlugin({
logger: {
warn: () => "",
},
}),
{
name: "external-files",
setup(inBuild) {
inBuild.onResolve({ filter: /(\.\/assets|\.\/fonts|\/systems)/ }, () => {
return { external: true };
});
},
},
],
});