forked from paulober/MicroPico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
42 lines (40 loc) · 1.05 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
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 copy from 'rollup-plugin-copy';
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: [
!isProduction && copy({
targets: [
{
src: 'node_modules/@paulober/pyboard-serial-com/scripts',
dest: 'dist/'
},
],
}),
nodeResolve({
preferBuiltins: true,
}),
commonjs(),
typescript({
tsconfig: 'tsconfig.json',
}),
isProduction && terser(),
// required by axios
json(),
],
};