-
Notifications
You must be signed in to change notification settings - Fork 27
/
rollup.config.mjs
44 lines (42 loc) · 1.11 KB
/
rollup.config.mjs
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
import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
const isProduction = process.env.BUILD === 'production';
export default {
input: 'src/extension.mts',
output: {
//dir: 'dist',
file: 'dist/extension.cjs',
format: 'cjs',
sourcemap: true,
exports: 'named'
},
external: [
'vscode'
],
plugins: [
// moved to publish.sh
/*isProduction && copy({
targets: [
{
src: 'node_modules/@serialport/bindings-cpp/prebuilds',
dest: './'
},
],
}),*/
nodeResolve({
preferBuiltins: true,
}),
commonjs({
ignoreDynamicRequires: true,
}),
typescript({
tsconfig: 'tsconfig.json',
}),
isProduction && terser(),
// required by axios and serialport
json(),
],
};