-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrollup.config.js
More file actions
38 lines (33 loc) · 787 Bytes
/
rollup.config.js
File metadata and controls
38 lines (33 loc) · 787 Bytes
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
import fs from 'fs';
import es3 from 'rollup-plugin-es3';
import replace from 'rollup-plugin-post-replace';
import babel from 'rollup-plugin-babel';
import memory from 'rollup-plugin-memory';
var babelRc = JSON.parse(fs.readFileSync('.babelrc','utf8')); // eslint-disable-line
export default {
exports: 'default',
useStrict: false,
globals: {
preact: 'preact'
},
plugins: [
memory({
path: 'src/index',
contents: "export { default } from './index';"
}),
babel({
babelrc: false,
presets: [
['es2015', { loose:true, modules:false }]
].concat(babelRc.presets.slice(1)),
plugins: babelRc.plugins,
exclude: 'node_modules/**'
}),
// strip Object.freeze()
es3(),
// remove Babel helpers
replace({
'throw ': 'return; throw '
})
]
};