Describe the bug
在执行 start 命令后,执行 build 命令,会出现上图的错误。将 @ice/app 版本回退到 3.4.11 后便不会出现这种问题。
Expected behavior
希望可以在执行 start 时,也可以执行 build 命令。
Actual behavior
No response
Version of ice.js
3.6.5
Content of build.json or ice.config.mts
import { defineConfig } from '@ice/app';
import icestark from '@ice/plugin-icestark';
import def from '@ali/ice-plugin-def';
import request from '@ice/plugin-request';
import provider from './provider-plugin';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
import webpack from 'webpack';
export default defineConfig(() => ({
ssg: false,
codeSplitting: false,
devPublicPath: `http://127.0.0.1:${process.env.ICE_CORE_DEV_PORT}/`,
plugins: [icestark({
type: 'child'
}), def(), request(), provider()],
routes: {
ignoreFiles: ['**/components/**', '**/context.ts', '**/enum.ts', '**/tools.ts', '**/constant.ts']
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
antd: 'antd',
dayjs: 'dayjs'
},
postcss: {
plugins: [['tailwindcss', {}], ['autoprefixer', {}]]
},
webpack: config => {
config.cache = {
type: 'filesystem',
compression: 'gzip',
buildDependencies: {
config: ['./ice.config.mts', './package.json']
}
};
config.plugins?.push(new webpack.NormalModuleReplacementPlugin(/node:/, resource => {
const mod = resource.request.replace(/^node:/, '');
resource.request = mod;
}) as any, new NodePolyfillPlugin() as any);
// 增加 style-loader,将 css 样式打包到 js 文件中,以解决 css 样式串行加载导致的加载性能问题
config.module?.rules?.forEach((rule: any) => {
if (['/\\.css$/', '/\\.less$/', '/\\.scss$/'].includes(rule?.test?.toString())) {
rule.use = rule.use.filter(item => !item.loader.includes('mini-css-extract-plugin'));
rule.use.unshift({
loader: 'style-loader'
});
}
});
config.module?.rules?.unshift({
test: /\.m?js$/,
resolve: {
fullySpecified: false
}
});
// @ts-ignore
config.devServer.client.overlay = false;
return config;
}
}));
Additional context
No response
Describe the bug
在执行 start 命令后,执行 build 命令,会出现上图的错误。将 @ice/app 版本回退到 3.4.11 后便不会出现这种问题。
Expected behavior
希望可以在执行 start 时,也可以执行 build 命令。
Actual behavior
No response
Version of ice.js
3.6.5
Content of build.json or ice.config.mts
Additional context
No response