-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathesbuild.config.js
36 lines (35 loc) · 970 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
import { build } from 'esbuild';
import { sassPlugin } from 'esbuild-sass-plugin';
import templatePaths from './tools/get-template-paths.js';
export default ({ watch = false, production = false } = {}) =>
build({
bundle: true,
entryPoints: ['./src/yze-combat.js', './src/yze-combat.scss'],
outdir: 'dist',
format: 'esm',
logLevel: 'info',
sourcemap: !production ? 'inline' : false,
ignoreAnnotations: !production,
minifyWhitespace: true,
minifySyntax: true,
drop: production ? ['console', 'debugger'] : [],
watch,
define: {
PATHS: JSON.stringify(templatePaths),
},
plugins: [
sassPlugin({
logger: {
warn: () => '',
},
}),
{
name: 'external-files',
setup(inBuild) {
inBuild.onResolve({ filter: /(\.\/assets|\.\/fonts|\.\/icons|\/systems)/ }, () => {
return { external: true };
});
},
},
],
});