-
Notifications
You must be signed in to change notification settings - Fork 162
/
rollup.config.js
35 lines (33 loc) · 1.04 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
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import uglify from 'rollup-plugin-uglify'
import babel from 'rollup-plugin-babel'
import vue from 'rollup-plugin-vue'
import replace from 'rollup-plugin-replace'
import json from 'rollup-plugin-json'
// `npm run build` -> `production` is true
// `npm run dev` -> `production` is false
const production = !process.env.ROLLUP_WATCH
export default {
entry: `src/index.js`,
dest: `dist/vue-progressbar.js`,
format: 'umd',
moduleName: 'VueProgressBar',
plugins: [
json(),
vue({
css: true
}),
replace({
'process.env.NODE_ENV': JSON.stringify( 'production' )
}),
resolve({
browser: true,
extensions: ['.vue', '.js', '.json']
}), // tells Rollup how to find date-fns in node_modules
commonjs(), // converts date-fns to ES modules
babel(),
production && uglify() // minify, but only in production
],
sourceMap: false
}