代码拉取完成,页面将自动刷新
同步操作将从 ayiaq1/ant-design-charts 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const webpack = require('webpack');
const fs = require('fs');
const path = require('path');
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
process.env.NODE_ENV = 'production';
module.exports = {
entry: {
// charts: ['@babel/polyfill', './src/index.ts'],
charts: './src/index.charts.ts',
charts_g6: './src/index.g6.ts',
},
output: {
filename: '[name].min.js',
library: '[name]',
libraryTarget: 'umd',
path: resolveApp('dist/'),
},
resolve: {
mainFields: ['module', 'main'],
extensions: ['.ts', '.tsx', '.js'],
modules: ['node_modules'],
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
module: {
rules: [
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
include: [path.resolve('src')],
loader: require.resolve('babel-loader'),
options: {
customize: require.resolve('babel-preset-react-app/webpack-overrides'),
presets: [
[
require.resolve('babel-preset-react-app'),
{
runtime: 'classic',
},
],
],
plugins: [
[
require.resolve('babel-plugin-named-asset-import'),
{
loaderMap: {
svg: {
ReactComponent: '@svgr/webpack?-svgo,+titleProp,+ref![path]',
},
},
},
],
].filter(Boolean),
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
// See #6846 for context on why cacheCompression is disabled
cacheCompression: false,
compact: true,
},
},
{
test: /\.(js|mjs)$/,
exclude: /@babel(?:\/|\\{1,2})runtime/,
loader: require.resolve('babel-loader'),
options: {
babelrc: false,
configFile: false,
compact: false,
presets: [[require.resolve('babel-preset-react-app/dependencies'), { helpers: true }]],
cacheDirectory: true,
// See #6846 for context on why cacheCompression is disabled
cacheCompression: false,
// Babel sourcemaps are needed for debugging into node_modules
// code. Without the options below, debuggers like VSCode
// show incorrect code and set breakpoints on the wrong lines.
sourceMaps: true,
inputSourceMap: true,
},
},
],
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new ForkTsCheckerWebpackPlugin({
eslint: undefined,
}),
new webpack.optimize.AggressiveMergingPlugin(),
...(process.env.MODE === 'ANALYZER'
? [new BundleAnalyzerPlugin({ analyzerMode: 'static' })]
: []),
],
performance: {
hints: false,
},
devtool: 'source-map',
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。