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
"Route" components are automatically code-splitted at build time to create smaller bundles and avoid loading more code than is needed by each page. This works by intercepting imports for route components with an [async loader](https://github.com/preactjs/preact-cli/tree/master/packages/async-loader), which returns a lightweight wrapper component that handles code splitting seamlessly.
361
-
362
-
Automatic code splitting is applied to all JavaScript and TypeScript files in the following locations:
> Automatic code splitting **only** supports default exports, not named exports:
389
-
>
390
-
> ```diff
391
-
> - import { Profile } from './routes/profile';
392
-
> + import Profile from './routes/profile';
393
-
> ```
394
-
>
395
-
> This is an intentional limitation that ensures effective code splitting. For components that need named exports, place them in a directory that doesn't trigger automatic code splitting. You can then manually code-split the default export by re-exporting it from `routes/` or importing it with the `"async!"` prefix.
396
-
397
356
[promise]: https://npm.im/promise-polyfill
398
357
[fetch]: https://github.com/developit/unfetch
399
358
[preact]: https://github.com/preactjs/preact
@@ -420,7 +379,6 @@ Automatic code splitting is applied to all JavaScript and TypeScript files in th
0 commit comments