镜像自地址
https://github.com/wikimedia/mediawiki-extensions-GrowthExperiments.git
已同步 2024-06-03 02:40:34 +08:00
9f10e8e352
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
29 行
608 B
JavaScript
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 );
|
|
}
|
|
};
|