Merge pull request #16921 from ant-design/packtracker

test: Add packtracker
This commit is contained in:
偏右 2019-06-02 20:23:01 +08:00 committed by GitHub
commit 8b1985bc9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -97,6 +97,7 @@
},
"devDependencies": {
"@ant-design/colors": "^3.0.0",
"@packtracker/webpack-plugin": "^2.0.1",
"@sentry/browser": "^5.0.3",
"@types/classnames": "^2.2.6",
"@types/prop-types": "^15.5.6",

View File

@ -1,6 +1,7 @@
/* eslint no-param-reassign: 0 */
// This config is for building dist files
const getWebpackConfig = require('antd-tools/lib/getWebpackConfig');
const PacktrackerPlugin = require('@packtracker/webpack-plugin');
const { webpack } = getWebpackConfig;
@ -35,6 +36,14 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
ignoreMomentLocale(config);
externalMoment(config);
addLocales(config);
// https://docs.packtracker.io/uploading-your-webpack-stats/webpack-plugin
config.plugins.push(
new PacktrackerPlugin({
project_token: '8adbb892-ee4a-4d6f-93bb-a03219fb6778',
upload: process.env.CI === 'true',
fail_build: true,
}),
);
});
}