-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesbuild.js
55 lines (51 loc) · 1.35 KB
/
esbuild.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import esbuild from 'esbuild';
import { sassPlugin } from 'esbuild-sass-plugin';
const buildProd = async function () {
return esbuild.build({
entryPoints: [
'src/styles/strigo.scss',
'src/styles/strigo-widget.scss',
'src/styles/strigo-academy-hat.scss',
'src/styles/strigo-assessment-recorder.scss',
'src/strigo.sdk.ts',
],
outdir: 'dist/production',
platform: 'browser',
plugins: [sassPlugin()],
outExtension: { '.js': '.min.js', '.css': '.min.css' },
bundle: true,
minify: true,
define: {
IS_DEVELOPMENT: `"false"`,
},
});
};
const buildDev = async function () {
return esbuild.build({
logLevel: 'debug',
metafile: true,
entryPoints: [
'src/styles/strigo.scss',
'src/styles/strigo-widget.scss',
'src/styles/strigo-academy-hat.scss',
'src/styles/strigo-assessment-recorder.scss',
'src/strigo.sdk.ts',
],
platform: 'browser',
plugins: [sassPlugin()],
outdir: 'dist/development',
bundle: true,
define: {
IS_DEVELOPMENT: `"false"`,
},
});
};
const build = async function () {
await buildProd();
console.log('⚡ Production Build complete! ⚡');
await buildDev();
console.log('⚡ Development Build complete! ⚡');
};
build()
.then(() => console.log('⚡ Build complete! ⚡'))
.catch(() => process.exit(1));