Skip to content

Commit 8eda417

Browse files
committed
simpify build script
1 parent 54176fc commit 8eda417

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rollup.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@ import pnp from 'rollup-plugin-pnp-resolve';
33
import commonjs from '@rollup/plugin-commonjs';
44
import resolve from '@rollup/plugin-node-resolve';
55
import babel from '@rollup/plugin-babel';
6+
import pkg from './package.json';
67

78
export default [
89
{
910
input: 'src/bundle.js',
1011
output: {
11-
file: 'build/Chart.BoxPlot.js',
12+
file: pkg.main,
1213
name: 'ChartBoxPlot',
1314
format: 'umd',
1415
globals: {
1516
'chart.js': 'Chart',
1617
},
1718
},
18-
external: ['chart.js'],
19+
external: Object.keys(pkg.peerDependencies),
1920
plugins: [commonjs(), pnp(), resolve(), babel({ babelHelpers: 'runtime' })],
2021
},
2122
{
2223
input: 'src/index.js',
2324
output: {
24-
file: 'build/Chart.BoxPlot.esm.js',
25-
name: 'ChartBoxPlot',
25+
file: pkg.module,
2626
format: 'esm',
2727
globals: {
2828
'chart.js': 'Chart',
2929
},
3030
},
31-
external: ['chart.js', '@babel/runtime', '@sgratzl/science.js'],
31+
external: Object.keys(pkg.peerDependencies).concat(Object.keys(pkg.dependencies)),
3232
plugins: [commonjs(), pnp(), resolve()],
3333
},
3434
];

0 commit comments

Comments
 (0)