-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.dev.js
48 lines (45 loc) · 1.14 KB
/
rollup.config.dev.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
const path = require('path');
const { nodeResolve } = require('@rollup/plugin-node-resolve'); //解决安装依赖的问题
const commonjs = require('@rollup/plugin-commonjs');
const { babel } = require('@rollup/plugin-babel');
const json = require('@rollup/plugin-json');
const vuePlugin = require('rollup-plugin-vue');
const postcss = require('rollup-plugin-postcss'); //CSS文件导入JS文件中
const inputPath = path.resolve(__dirname, './src/index.js');
const outputUmdPath = path.resolve(__dirname, './dist/thunderUmd.js');
const outputEsPath = path.resolve(__dirname, './dist/thunderEs.js');
module.exports = {
input: inputPath,
output: [
{
file: outputUmdPath,
format: 'umd',
name: 'thunderDataV',
globals: {
vue: 'Vue',
echarts:'Echarts'
},
},
{
file: outputEsPath,
format: 'es',
name: 'thunderDataV',
globals: {
vue: 'Vue',
},
},
],
plugins: [
vuePlugin(),
nodeResolve(),
commonjs(),
babel({
exclude: 'node-modules/**'
}),
json(),
postcss({
plugins: [],
}),
],
external: ['vue','echarts'],
};