2022-04-13 11:33:02 +08:00
|
|
|
import { defineConfig } from '@ice/app';
|
2022-04-15 10:53:30 +08:00
|
|
|
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
|
2022-11-11 11:02:51 +08:00
|
|
|
import customPlugin from './plugin';
|
2022-03-31 15:12:33 +08:00
|
|
|
|
2022-11-11 11:02:51 +08:00
|
|
|
export default defineConfig(() => ({
|
2022-03-31 15:12:33 +08:00
|
|
|
publicPath: '/',
|
2022-07-21 15:05:10 +08:00
|
|
|
syntaxFeatures: {
|
|
|
|
exportDefaultFrom: true,
|
|
|
|
},
|
2022-04-29 16:16:00 +08:00
|
|
|
define: {
|
|
|
|
HAHA: JSON.stringify(true),
|
|
|
|
'process.env.HAHA': JSON.stringify(true),
|
|
|
|
},
|
2022-07-08 17:34:11 +08:00
|
|
|
transform: (code, id) => {
|
2022-11-11 11:02:51 +08:00
|
|
|
if (id.includes('src/pages') && id.endsWith('.js')) {
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
return null;
|
2022-07-08 17:34:11 +08:00
|
|
|
},
|
2022-03-31 15:12:33 +08:00
|
|
|
webpack: (webpackConfig) => {
|
|
|
|
if (process.env.NODE_ENV !== 'test') {
|
2022-04-15 10:53:30 +08:00
|
|
|
webpackConfig.plugins?.push(new SpeedMeasurePlugin());
|
2022-03-31 15:12:33 +08:00
|
|
|
}
|
|
|
|
return webpackConfig;
|
|
|
|
},
|
2022-04-14 21:13:10 +08:00
|
|
|
dropLogLevel: 'warn',
|
2022-09-07 14:49:54 +08:00
|
|
|
plugins: [
|
2022-11-11 11:02:51 +08:00
|
|
|
customPlugin(),
|
2022-09-07 14:49:54 +08:00
|
|
|
],
|
2022-06-07 14:23:35 +08:00
|
|
|
eslint: true,
|
2022-11-11 11:02:51 +08:00
|
|
|
}));
|