|
@ -1,7 +1,6 @@ |
|
|
/* eslint no-param-reassign: 0 */ |
|
|
/* eslint no-param-reassign: 0 */ |
|
|
// This config is for building dist files
|
|
|
// This config is for building dist files
|
|
|
const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig'); |
|
|
const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig'); |
|
|
const PacktrackerPlugin = require('@packtracker/webpack-plugin'); |
|
|
|
|
|
const IgnoreEmitPlugin = require('ignore-emit-webpack-plugin'); |
|
|
const IgnoreEmitPlugin = require('ignore-emit-webpack-plugin'); |
|
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; |
|
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; |
|
|
const darkVars = require('./scripts/dark-vars'); |
|
|
const darkVars = require('./scripts/dark-vars'); |
|
@ -56,19 +55,6 @@ function processWebpackThemeConfig(themeConfig, theme, vars) { |
|
|
const themeReg = new RegExp(`${theme}(.min)?\\.js(\\.map)?$`); |
|
|
const themeReg = new RegExp(`${theme}(.min)?\\.js(\\.map)?$`); |
|
|
// ignore emit ${theme} entry js & js.map file
|
|
|
// ignore emit ${theme} entry js & js.map file
|
|
|
config.plugins.push(new IgnoreEmitPlugin(themeReg)); |
|
|
config.plugins.push(new IgnoreEmitPlugin(themeReg)); |
|
|
|
|
|
|
|
|
// skip codesandbox ci
|
|
|
|
|
|
if (!process.env.CSB_REPO) { |
|
|
|
|
|
// https://docs.packtracker.io/uploading-your-webpack-stats/webpack-plugin
|
|
|
|
|
|
config.plugins.push( |
|
|
|
|
|
new PacktrackerPlugin({ |
|
|
|
|
|
project_token: '30c6a021-96c0-4d67-8bd2-0d2fcbd8962b', |
|
|
|
|
|
upload: process.env.CI === 'true', |
|
|
|
|
|
fail_build: false, |
|
|
|
|
|
exclude_assets: name => ![`antd.${theme}.min.js`, `antd.${theme}.min.css`].includes(name), |
|
|
|
|
|
}), |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -84,14 +70,7 @@ if (process.env.RUN_ENV === 'PRODUCTION') { |
|
|
config.optimization.usedExports = true; |
|
|
config.optimization.usedExports = true; |
|
|
// skip codesandbox ci
|
|
|
// skip codesandbox ci
|
|
|
if (!process.env.CSB_REPO) { |
|
|
if (!process.env.CSB_REPO) { |
|
|
// https://docs.packtracker.io/uploading-your-webpack-stats/webpack-plugin
|
|
|
|
|
|
config.plugins.push( |
|
|
config.plugins.push( |
|
|
new PacktrackerPlugin({ |
|
|
|
|
|
project_token: '30c6a021-96c0-4d67-8bd2-0d2fcbd8962b', |
|
|
|
|
|
upload: process.env.CI === 'true', |
|
|
|
|
|
fail_build: false, |
|
|
|
|
|
exclude_assets: name => !['antd.min.js', 'antd.min.css'].includes(name), |
|
|
|
|
|
}), |
|
|
|
|
|
new BundleAnalyzerPlugin({ |
|
|
new BundleAnalyzerPlugin({ |
|
|
analyzerMode: 'static', |
|
|
analyzerMode: 'static', |
|
|
openAnalyzer: false, |
|
|
openAnalyzer: false, |
|
|