-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
40 lines (39 loc) · 1.09 KB
/
rollup.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
37
38
39
40
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import typescript from 'rollup-plugin-typescript2'
import terser from '@rollup/plugin-terser'
import replace from '@rollup/plugin-replace'
import tsc from 'typescript'
export default {
input: 'src/WS.ts',
output: {
file: process.env.NODE_ENV=='development'
? 'dist/bundle.dev.js'
: process.env.BUILD == 'cjs' ? 'dist/bundle.cjs' : 'dist/bundle.mjs',
format: process.env.BUILD == 'cjs' ? 'cjs' : 'es',
name: 'wspromisify'
},
treeshake: { moduleSideEffects: false },
plugins: [
resolve(),
commonjs(),
typescript({
typescript: tsc,
tsconfig: "./tsconfig.json",
tsconfigOverride: {
compilerOptions: {
sourceMap: false,
inlineSourceMap: process.env.NODE_ENV=='development',
module: 'esnext'
}
}
}),
process.env.NODE_ENV!='development' && terser(),
replace({
preventAssignment: true,
values: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}
})
]
}