Build your Nuxt app into a single HTML file by inlining all your CSS and JavaScript.
This module has been heavily inspired by vite-plugin-singlefile, and aims to provide the same functionality for Nuxt. It is currently in a very early stage, and is not recommended for production use.
- Add
nuxt-singlefile
dependency to your project
# Using pnpm
pnpm add -D nuxt-singlefile
# Using yarn
yarn add --dev nuxt-singlefile
# Using npm
npm install --save-dev nuxt-singlefile
- Add
nuxt-singlefile
to themodules
section ofnuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-singlefile"],
});
That's it! You can now use Nuxt Single File in your Nuxt app ✨
# Install dependencies
pnpm install
# Generate type stubs
pnpm run dev:prepare
# Develop with the playground
pnpm run dev
# Build the playground
pnpm run dev:build
# Run ESLint
pnpm run lint
# Run Vitest
pnpm run test
pnpm run test:watch
# Release new version
pnpm run release