Closed kuldeepkeshwar closed 4 years ago
rollup-plugin-size uses below code to extend default options check here
rollup-plugin-size
const coreOptions = Object.assign(defaults, options);
In case of multiple instance of rollup-plugin-size, the options gets overwritten by the last instance's option.
e.g rollup.config.js
import size from 'rollup-plugin-size'; import pkg from './package.json' export default [ { input: 'src/index.js', output: { file: 'dist/index.js' format: 'cjs', }, plugins: [ size({filename:'sizes-cjs.json'})], }, { input: 'src/index.js', output: { file: 'dist/index.es.js' format: 'es', }, plugins: [ size({filename:'sizes-es.json'})], }, ]
above configuration only create sizes-es.json file, ideally, it should create both(sizes-es.json & sizes-cjs.json) files
sizes-es.json
sizes-cjs.json
rollup-plugin-size
uses below code to extend default options check hereIn case of multiple instance of
rollup-plugin-size
, the options gets overwritten by the last instance's option.e.g rollup.config.js
above configuration only create
sizes-es.json
file, ideally, it should create both(sizes-es.json
&sizes-cjs.json
) files