mediawiki-extensions-Growth.../rollup.config.js
Kosta Harlan 9f10e8e352
NewImpact: Use d3 subpackages
Create a custom build of d3 subpackages we need for the Impact module.
This results in a reduction from 279kB to 115kB.

To generate the minified files, run `npm run rollup`.

Since we're no longer pulling d3.min.js from an npm package dist
directory, remove the entry in foreign-resources.yaml.

Co-authored-by: Eric Gardner <egardner@wikimedia.org>
Bug: T321215
Change-Id: If6f6caf84c33aee4d051cbf5d866b1610ce14b23
2022-11-10 09:50:46 +01:00

29 行
608 B
JavaScript

'use strict';
const resolve = require( '@rollup/plugin-node-resolve' );
const terser = require( '@rollup/plugin-terser' );
/**
* Config file for generating a custom build of d3, containing only the packages
* we need for the Impact module.
*/
module.exports = {
input: 'modules/lib/d3/index.js',
output: {
file: 'modules/lib/d3/d3.min.js',
format: 'umd',
compact: false,
name: 'd3'
},
plugins: [
resolve(),
terser()
],
// upstream d3 rollup.config.js has this as well.
onwarn( message, warn ) {
if ( message.code === 'CIRCULAR_DEPENDENCY' ) {
return;
}
warn( message );
}
};