You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When formatted as CommonJS (CJS), the server bundle will encompass all pages, leading to an increased bundle size as the number of pages grows. To optimize, we should bundle only the necessary server source code required for operation.
Usage example | 使用示例
No response
Detailed design | 方案设计
A new configuration option will be introduced to manage the bundling strategy:
import{defineConfig}from'@ice/app';exportdefaultdefineConfig(()=>({server: {format: 'cjs',// Bundle strategy `page` will only works in cjs format.bundle: 'page',}}));
When bundle: 'page' is set, the following actions will be executed:
Multiple server entries will be generated, corresponding to each page path
Each entry will import only the essential components required for that specific page
esbuild will compile each entry in parallel
The name of the output file will correspond to the route's path
Additional context | 额外信息
No response
The text was updated successfully, but these errors were encountered:
Summary | 概述
No response
Motivation | 背景
When formatted as CommonJS (CJS), the server bundle will encompass all pages, leading to an increased bundle size as the number of pages grows. To optimize, we should bundle only the necessary server source code required for operation.
Usage example | 使用示例
No response
Detailed design | 方案设计
A new configuration option will be introduced to manage the bundling strategy:
When
bundle: 'page'
is set, the following actions will be executed:esbuild
will compile each entry in parallelAdditional context | 额外信息
No response
The text was updated successfully, but these errors were encountered: