diff --git a/rollup.config.js b/rollup.config.js index 370890a..b46cdfa 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,32 +3,32 @@ import pnp from 'rollup-plugin-pnp-resolve'; import commonjs from '@rollup/plugin-commonjs'; import resolve from '@rollup/plugin-node-resolve'; import babel from '@rollup/plugin-babel'; +import pkg from './package.json'; export default [ { input: 'src/bundle.js', output: { - file: 'build/Chart.BoxPlot.js', + file: pkg.main, name: 'ChartBoxPlot', format: 'umd', globals: { 'chart.js': 'Chart', }, }, - external: ['chart.js'], + external: Object.keys(pkg.peerDependencies), plugins: [commonjs(), pnp(), resolve(), babel({ babelHelpers: 'runtime' })], }, { input: 'src/index.js', output: { - file: 'build/Chart.BoxPlot.esm.js', - name: 'ChartBoxPlot', + file: pkg.module, format: 'esm', globals: { 'chart.js': 'Chart', }, }, - external: ['chart.js', '@babel/runtime', '@sgratzl/science.js'], + external: Object.keys(pkg.peerDependencies).concat(Object.keys(pkg.dependencies)), plugins: [commonjs(), pnp(), resolve()], }, ];