-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.worker.js
54 lines (49 loc) · 1.34 KB
/
rollup.config.worker.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
// import path from 'path';
// import fs from 'fs';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
//import commonjs from 'rollup-plugin-commonjs';
// import inject from 'rollup-plugin-inject';
// let pkg = JSON.parse(fs.readFileSync('./package.json'));
// external = Object.keys(pkg.dependencies || {});
// babelRc = pkg.babel || JSON.parse(fs.readFileSync('./.babelrc'));
export default {
input: 'src/worker.js',
output: [
{
file: "dist/d3-worker.js",
format: 'cjs',
name: 'WorkerBundle'
},
],
sourcemap: false,
intro: 'var document = undefined;',
treeshake: true,
external: [
'wrapper', 'dom'
],
plugins: [
// inject({
// include: 'src/worker.js',
// exclude: 'node_modules/**',
// modules: {
// 'document': path.resolve('src/globals.js'),
// },
// }),
resolve({
jsnext: true,
main: true,
preferBuiltins: true,
browser: true,
modules: true,
customResolveOptions: {
moduleDirectory: 'node_modules'
},
}),
babel({
exclude: 'node_modules/**',
babelrc: true,
}),
// commonjs(),
],
};