-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollem.config.js
44 lines (43 loc) · 1.02 KB
/
rollem.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 buble = require('rollup-plugin-buble')
const uglify = require('rollup-plugin-uglify')
const cjs = require('rollup-plugin-commonjs')
const resolve = require('rollup-plugin-node-resolve')
const pkg = JSON.parse(fs.readFileSync('./package.json'))
const uglifyConfig = JSON.parse(fs.readFileSync('./uglify.json'))
const external = Object.keys(pkg['devDependencies'])
module.exports = [
{
entry: 'src/index.js',
external,
plugins: [
resolve({ jsnext: true, browser: true }),
cjs(),
buble({ jsx: 'h' })
],
sourceMap: true,
format: 'umd',
dest: pkg['main'],
moduleName: pkg['amdName'],
globals: {
preact: 'preact'
}
},
{
entry: 'src/index.js',
external,
plugins: [
resolve({ jsnext: true, browser: true }),
cjs(),
buble({ jsx: 'h' }),
uglify(uglifyConfig)
],
sourceMap: true,
format: 'umd',
dest: pkg['minified:main'],
moduleName: pkg['amdName'],
globals: {
preact: 'preact'
}
}
]