Generate web bundles with Nuxt 3
undefined⚠️ nuxt-web-bundle is an experiment. ⚠️undefined
With pnpm
pnpm add -D nuxt-web-bundle
Or, with npm
npm install -D nuxt-web-bundle
Or, with yarn
yarn add -D nuxt-web-bundle
export default defineNuxtConfig({
modules: ['nuxt-web-bundle'],
webBundle: {
baseURL: 'https://my-website.com',
// filename: 'bundle.wbn',
},
})
That’s it! Now when you run nuxi build or nuxi generate, a web bundle will be generated instead of a server or static directory.
As mentioned earlier, this is an experiment, and in order to experiment with Web Bundles, you can follow the steps here to enable usage in your version of Google Chrome.
corepack enablepnpm installpnpm dev:preparepnpm dev to start playground in development modeMuch of the implementation is taken from rollup-plugin-webbundle - check it out and try it if you are using Vite or another Rollup-based build system.
Made with ❤️
Published under the MIT License.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.