A highly-experimental module to enable bundling chunks on-demand in Nuxt 3
- ⚡️ Minimal extra chunk download
Install and add nuxt-on-demand
to your nuxt.config
.
# Whichever matches your package manager
pnpm add -D nuxt-on-demand
npm install -D nuxt-on-demand
yarn add -D nuxt-on-demand
export default defineNuxtConfig({
modules: ['nuxt-on-demand'],
})
No configuration is required. In production, you should see multiple imports being concatenated into single imports.
- Clone this repository
- Enable Corepack using
corepack enable
(usenpm i -g corepack
for Node.js < 16.10) - Install dependencies using
pnpm install
- Stub module with
pnpm dev:prepare
- Run
pnpm dev
to start playground in development mode
Made with ❤️
Published under the MIT License.