-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathes_config.js
53 lines (53 loc) · 1.49 KB
/
es_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
import path from 'path';
import resolve from 'rollup-plugin-node-resolve';
import common from 'rollup-plugin-commonjs';
import json from '@rollup/plugin-json';
import replace from '@rollup/plugin-replace';
export default {
input: {
main: path.resolve(__dirname, 'main/index.js'),
vendor: path.resolve(__dirname, 'utils/index.js')
},
external: [
'jquery',
'lodash'
],
plugins: [
resolve({
mainFields: ['module', 'main'],
browser: true
}),
json(),
common({
include: 'node_modules/**', // 包括
exclude: [], // 排除
}),
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
],
output: {
dir: path.resolve(__dirname, 'dist/es'),
format: 'es',
name: 'rollupTest',
entryFileNames: '[name]-[hash]-[format].js',
chunkFileNames: '[name]-[hash]-[format].js',
compact: false,
banner: '/* JohnApache JSLib */',
footer: '/* CopyRight @ 2019*/',
intro: '/* this is a introduction */',
outro: '/* this is an another introduction */',
extend: false,
sourcemap: false,
sourcemapPathTransform: (relativePath) => {
return relativePath;
},
strictDeprecations: false
},
treeshake: {
moduleSideEffects: true
},
manualChunks: {
'myLib': [path.resolve(__dirname, './myLib/index.js')]
}
}