Skip to content

Commit d6b5fd1

Browse files
committed
build: optimizing rollup config files
1 parent fa3a0a7 commit d6b5fd1

File tree

2 files changed

+36
-37
lines changed

2 files changed

+36
-37
lines changed

Diff for: rollup.config.dev.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import resolve from 'rollup-plugin-node-resolve'
2-
import replace from 'rollup-plugin-replace'
3-
import VueLoader from 'rollup-plugin-vue'
4-
import babel from 'rollup-plugin-babel'
5-
import commonJs from 'rollup-plugin-commonjs'
6-
import eslint from 'rollup-plugin-eslint'
1+
import buble from '@rollup/plugin-buble'
2+
import commonJs from '@rollup/plugin-commonjs'
3+
import resolve from '@rollup/plugin-node-resolve'
74
import chokidar from 'chokidar'
5+
import { eslint } from 'rollup-plugin-eslint'
6+
import vue from 'rollup-plugin-vue'
87

98
export default {
109
input: 'src/index.js',
@@ -13,24 +12,25 @@ export default {
1312
include: ['src/**']
1413
},
1514
plugins: [
15+
resolve(),
16+
commonJs(),
1617
eslint({
1718
include: './src/**'
1819
}),
19-
babel({
20-
exclude: './node_modules/**'
20+
buble({
21+
objectAssign: true
2122
}),
22-
resolve(),
23-
commonJs(),
24-
VueLoader(),
25-
replace({
26-
'process.env.NODE_ENV': JSON.stringify('development')
27-
})
23+
vue()
2824
],
2925
output: [
3026
{
3127
name: 'VueAxe',
3228
file: 'demo/vue-axe.js',
33-
format: 'umd'
29+
format: 'umd',
30+
exports: 'named',
31+
globals: {
32+
'axe-core': 'axeCore'
33+
}
3434
}
3535
]
3636
}

Diff for: rollup.config.prod.js

+21-22
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
1-
import resolve from 'rollup-plugin-node-resolve'
2-
import replace from 'rollup-plugin-replace'
3-
import VueLoader from 'rollup-plugin-vue'
4-
import butternut from 'rollup-plugin-butternut'
5-
import babel from 'rollup-plugin-babel'
6-
import commonJs from 'rollup-plugin-commonjs'
1+
import buble from '@rollup/plugin-buble'
2+
import commonjs from '@rollup/plugin-commonjs'
3+
import resolve from '@rollup/plugin-node-resolve'
4+
import replace from '@rollup/plugin-replace'
5+
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
6+
import { terser } from 'rollup-plugin-terser'
7+
import vue from 'rollup-plugin-vue'
78

89
export default {
910
input: 'src/index.js',
1011
external: ['axe-core'],
1112
plugins: [
12-
babel({
13-
exclude: './node_modules/**'
14-
}),
15-
butternut(),
13+
peerDepsExternal(),
1614
resolve(),
17-
commonJs(),
18-
VueLoader(),
15+
commonjs(),
1916
replace({
2017
'process.env.NODE_ENV': JSON.stringify('production')
21-
})
18+
}),
19+
vue(),
20+
buble({
21+
objectAssign: true
22+
}),
23+
terser()
2224
],
23-
output: [
24-
{
25-
name: 'VueAxe',
26-
file: 'dist/vue-axe.js',
27-
format: 'umd',
28-
globals: {
29-
'axe-core': 'axeCore'
30-
}
25+
output: {
26+
name: 'VueAxe',
27+
exports: 'named',
28+
globals: {
29+
'axe-core': 'axeCore'
3130
}
32-
]
31+
}
3332
}

0 commit comments

Comments
 (0)