-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
45 lines (41 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
41
42
43
44
45
// rollup.config.js
import vue from 'rollup-plugin-vue'
import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import {terser} from 'rollup-plugin-terser'
import minimist from 'minimist'
// import css from 'rollup-plugin-css-only'
const argv = minimist(process.argv.slice(2))
const config = {
input: 'src/index.js',
output: {
name: 'VueGetCode',
exports: 'named'
},
plugins: [
commonjs(),
// https://rollup-plugin-vue.vuejs.org/examples.html#extract-css
// css({
// output: 'VueGetCode',
// }),
vue({
// css: false,
compileTemplate: true,
style: {
postcssPlugins: [require('autoprefixer')]
}
}),
babel({
// according to the issue, using .babelrc.js can ignore plugins option
// https://github.com/rollup/plugins/issues/381
babelHelpers: 'runtime',
extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', '.vue'],
exclude: 'node_modules/**'
})
]
}
// Only minify browser (iife) version
if (argv.format === 'iife') {
config.plugins.push(terser())
}
export default config