forked from pi0/clippyjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
executable file
·44 lines (41 loc) · 1.11 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
const fs = require('fs');
const path = require('path');
const buble = require('rollup-plugin-buble');
const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const uglify = require('rollup-plugin-uglify');
// const { minify } = require('uglify-js-harmony');
const { dependencies } = require('./package.json');
const name = 'clippy'
const dist = path.resolve(__dirname, 'dist');
// Ensure dist directory exists
if (!fs.existsSync(dist)) {
fs.mkdirSync(dist);
}
module.exports = {
entry: path.resolve(__dirname, 'lib/index.js'),
external: Object.keys(dependencies),
moduleName: name,
plugins: [
buble(),
resolve({ external: ['vue'] }),
commonjs(),
// uglify({}, minify)
],
globals: {
jquery: '$'
},
targets: [
{
format: 'umd',
moduleName: name,
dest: path.resolve(dist, name + '.js'),
sourceMap: true
},
{
format: 'es',
dest: path.resolve(dist, name + '.esm.js'),
sourceMap: true
}
]
};