Skip to content

v3.1.2

Compare
Choose a tag to compare
@ClarkXia ClarkXia released this 06 Mar 02:45
· 533 commits to master since this release
c23c10e

Enable on demand compile by config ice.config.mts:

import { defineConfig } from '@ice/app';
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
import customPlugin from './plugin';

export default defineConfig(() => ({
  ssr: true,
  server: {
    onDemand: true,
    // Strongly recommand to set esm format when use on demand compilation.
    format: 'esm',
  },
}));
  • Feat: support routes config for custom routing rules. #5852
import { defineConfig } from '@ice/app';

export default defineConfig({
  routes: {
    config: [
      {
        path: 'rewrite',
        // 从 src/page 开始计算路径,并且需要写后缀
        component: 'sales/layout.tsx',
        children: [
          {
            path: '/favorites',
            component: 'sales/favorites.tsx',
          },
          {
            path: 'overview',
            component: 'sales/overview.tsx',
          },
          {
            path: 'recommends',
            component: 'sales/recommends.tsx',
          },
        ],
      },
      {
        path: '/',
        component: 'index.tsx',
      },
    ],
  },
});

We strongly recommend to use file system routing, which makes routes more predictable and intuitive.