-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathbuild.js
28 lines (26 loc) · 953 Bytes
/
build.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
const esbuild = require('esbuild');
const { lessLoader } = require('esbuild-plugin-less');
const isDev = process.argv.includes('--dev');
!(async () => {
if (isDev) {
await esbuild.build({
entryPoints: ['./src/main.tsx', './src/startup_script.ts', './src/style.less'],
bundle: true,
sourcemap: 'inline',
target: 'chrome91',
outdir: '.',
plugins: [lessLoader()],
});
} else {
await esbuild.build({
entryPoints: ['./src/main.tsx', './src/startup_script.ts', './src/style.less'],
bundle: true,
minify: true,
outdir: 'dist',
target: 'chrome91',
plugins: [lessLoader()],
});
const compress = require('compressing');
await compress.zip.compressDir('./dist/', './RevivedUnblockNeteaseMusic.plugin', { ignoreBase: true });
}
})()