-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathesbuild.config.js
36 lines (35 loc) · 969 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/blade-runner.js', './src/blade-runner.scss'],
outdir: 'dist',
format: 'esm',
logLevel: 'info',
sourcemap: !production ? 'inline' : false,
ignoreAnnotations: !production,
minifyWhitespace: true,
minifySyntax: true,
drop: production ? ['console', 'debugger'] : [],
watch,
define: {
TEMPLATE_PATHS: JSON.stringify(templatePaths),
},
plugins: [
sassPlugin({
logger: {
warn: () => '',
},
}),
{
name: 'external-files',
setup(inBuild) {
inBuild.onResolve({ filter: /(\/assets|\/fonts|\/systems)/ }, () => {
return { external: true };
});
},
},
],
});