Skip to content

Bundle script into html head with nuxt shared build config.

Notifications You must be signed in to change notification settings

undermoonn/nuxt-inline-script

Repository files navigation

🚧 Nuxt Inline Script

This module is under development, DO NOT use in production.

npm version npm downloads License Nuxt

Bundle script into html head with nuxt shared build config.

Quick Setup

  1. Add nuxt-inline-script dependency to your project
# Using pnpm
pnpm add -D nuxt-inline-script

# Using yarn
yarn add --dev nuxt-inline-script

# Using npm
npm install --save-dev nuxt-inline-script
  1. Add nuxt-inline-script to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-inline-script'],
  inlineScript: {
    buildEntry: ['path/to/script']
  }
})

That's it! You can now use My Module in your Nuxt app ✨

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

About

Bundle script into html head with nuxt shared build config.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published