ice/examples/basic-project/ice.config.mts

32 lines
737 B
TypeScript
Raw Normal View History

import { defineConfig } from '@ice/app';
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
import customPlugin from './plugin';
export default defineConfig(() => ({
publicPath: '/',
syntaxFeatures: {
exportDefaultFrom: true,
},
define: {
HAHA: JSON.stringify(true),
'process.env.HAHA': JSON.stringify(true),
},
transform: (code, id) => {
if (id.includes('src/pages') && id.endsWith('.js')) {
return code;
}
return null;
},
webpack: (webpackConfig) => {
if (process.env.NODE_ENV !== 'test') {
webpackConfig.plugins?.push(new SpeedMeasurePlugin());
}
return webpackConfig;
},
dropLogLevel: 'warn',
plugins: [
customPlugin(),
],
2022-06-07 14:23:35 +08:00
eslint: true,
}));