-
Notifications
You must be signed in to change notification settings - Fork 30
/
rollup.config.js
65 lines (61 loc) · 1.73 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import vue from 'rollup-plugin-vue';
import nodeResolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-buble';
import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import scss from 'rollup-plugin-scss';
import copy from 'rollup-plugin-copy-assets';
import includePaths from 'rollup-plugin-includepaths';
import alias from '@rollup/plugin-alias';
import pkg from './package.json';
const extensions = ['.js', '.vue'];
const config = {
input: 'src/lib/index.js',
external: Object.keys(Object.assign(pkg.peerDependencies, pkg.dependencies)),
output: [{
format: 'cjs',
name: 'vue-color-gradient-picker', // umd and iife for var name = (function(){})()
entryFileNames: 'index-[format].js',
dir: 'dist',
sourcemap: true,
}, {
format: 'es',
dir: 'dist',
entryFileNames: 'index-[format].js',
sourcemap: true,
name: 'vue-color-gradient-picker',
}],
plugins: [
vue(),
scss({
output: 'dist/index.css',
}),
nodeResolve({
mainFields: ['module', 'main', 'browser'],
extensions,
}),
commonjs(),
babel({
exclude: './node_modules/**',
extensions,
objectAssign: 'Object.assign',
}),
json(),
copy({
assets: [
// You can include directories
'src/lib/assets',
],
}),
includePaths({
paths: ['src'],
extensions: ['.js', '.vue'],
}),
alias({
entries: {
['@']: __dirname + '/src'
}
}),
],
};
export default config;