-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
rollup.config.js
56 lines (55 loc) · 1.27 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { join } from 'path'
import copy from 'rollup-plugin-copy'
import json from '@rollup/plugin-json'
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import nodePolyfills from 'rollup-plugin-node-polyfills'
import typescript from '@rollup/plugin-typescript'
import replace from '@rollup/plugin-replace'
export default {
input: join(__dirname, './src/main.ts'),
output: {
format: 'cjs',
exports: 'auto',
dir: join(__dirname, `./build`),
preserveModules: true,
},
plugins: [
copy({
targets: [
// { src: './src/info.json', dest: `build` },
],
}),
json({ namedExports: false }),
resolve({
extensions: ['.js', '.ts'],
preferBuiltins: true,
}),
commonjs({
include: ['node_modules/**'],
}),
replace({
values: {
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV || 'development',
),
'process.env.__VERSION__': JSON.stringify(
require('./package.json').version,
),
},
preventAssignment: true,
}),
nodePolyfills(),
typescript({}),
],
external: [
'crypto-js',
'$util',
'$http',
'$info',
'$option',
'$log',
'$data',
'$file',
],
}