diff --git a/formily/antd/playground/template.ejs b/formily/antd/playground/template.ejs index 65ebfaf..1eef29c 100644 --- a/formily/antd/playground/template.ejs +++ b/formily/antd/playground/template.ejs @@ -22,4 +22,9 @@ + + + diff --git a/formily/antd/playground/webpack.base.ts b/formily/antd/playground/webpack.base.ts index 1fe60d6..12b08fe 100644 --- a/formily/antd/playground/webpack.base.ts +++ b/formily/antd/playground/webpack.base.ts @@ -48,6 +48,9 @@ export default { 'react-dom': 'ReactDOM', moment: 'moment', antd: 'antd', + // 使用 externals 配置将 Ant Design Icons 指定为外部依赖,不进行打包处理。这样,在运行时会从 CDN 加载 Ant Design Icons。 + '@ant-design/icons': 'icons', // 这里假设从 CDN 加载的全局变量为 'icon' + // 'monaco-editor': 'monaco' // 这里假设从CDN加载的全局变量为'monaco' }, module: { rules: [ diff --git a/formily/antd/playground/webpack.prod.ts b/formily/antd/playground/webpack.prod.ts index 520f909..cc35115 100644 --- a/formily/antd/playground/webpack.prod.ts +++ b/formily/antd/playground/webpack.prod.ts @@ -1,8 +1,9 @@ import baseConfig from './webpack.base' import HtmlWebpackPlugin from 'html-webpack-plugin' import MiniCssExtractPlugin from 'mini-css-extract-plugin' -import MonacoPlugin from 'monaco-editor-webpack-plugin' +// import MonacoPlugin from 'monaco-editor-webpack-plugin' // 可以减少编辑器体积 import path from 'path' +import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' const createPages = (pages) => { return pages.map(({ filename, template, chunk }) => { @@ -19,6 +20,7 @@ export default { ...baseConfig, mode: 'production', plugins: [ + new BundleAnalyzerPlugin(), new MiniCssExtractPlugin({ filename: '[name].[hash].css', chunkFilename: '[id].[hash].css', @@ -30,9 +32,9 @@ export default { chunk: ['playground'], }, ]), - new MonacoPlugin({ - languages: ['json'], - }), + // new MonacoPlugin({ + // languages: ['json'], + // }), ], optimization: { minimize: true,