Nuxt Modules

作者 onmax008232b5d7a5MIT719 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫2 天前更新

Use when creating Nuxt modules: (1) Published npm modules (@nuxtjs/, nuxt-), (2) Local project modules (modules/ directory), (3) Runtime extensions (components, composables, plugins), (4) Server extensions (API routes, middleware), (5) Releasing/publishing modules to npm, (6) Setting up CI/CD workflows for modules. Provides defineNuxtModule patterns, Kit utilities, hooks, E2E testing, and release automation.

AI 產生的概覽

指導建立 Nuxt 模組,涵蓋模組結構、Kit 工具、鉤子、E2E 測試、發佈與 CI 工作流程。

功能
此技能為建構可擴充框架功能的 Nuxt 模組提供指引,包括發佈到 npm 的模組、專案本機模組、執行階段擴充與伺服器端擴充。它指向數個參考檔案,內容涵蓋 defineNuxtModule 模式、Kit 工具、鉤子、E2E 測試、最佳實務、npm 發佈,以及可直接複製的 CI/CD 工作流程範本。它也概述模組類型、專案結構與快速開始指令。
適用情境
適用於建立 Nuxt 模組時,無論是發佈到 npm 或供專案本機使用。也適用於新增執行階段或伺服器端擴充、撰寫 E2E 測試、發佈模組,或為模組設定 CI/CD 工作流程。
執行需求
僅為說明性內容,未附帶指令碼。依快速開始指令操作需要 Node.js、npm,以及用於 npx nuxi init 與安裝相依套件的網路存取。

Nuxt Module Development

Guide for creating Nuxt modules that extend framework functionality.

Related skills: nuxt (basics), vue (runtime patterns)

Quick Start

bash
npx nuxi init -t module my-modulecd my-module && npm installnpm run dev        # Start playgroundnpm run dev:build  # Build in watch modenpm run test       # Run tests

Available Guidance

  • references/development.md [blocked] - Module anatomy, defineNuxtModule, Kit utilities, hooks
  • references/testing-and-publishing.md [blocked] - E2E testing, best practices, releasing, publishing
  • references/ci-workflows.md [blocked] - Copy-paste CI/CD workflow templates

Loading Files

Consider loading these reference files based on your task:

  • references/development.md [blocked] - if building module features, using defineNuxtModule, or working with Kit utilities
  • references/testing-and-publishing.md [blocked] - if writing E2E tests, publishing to npm, or following best practices
  • references/ci-workflows.md [blocked] - if setting up CI/CD workflows for your module

DO NOT load all files at once. Load only what's relevant to your current task.

Module Types

TypeLocationUse Case
Publishednpm package@nuxtjs/, nuxt- distribution
Localmodules/ dirProject-specific extensions
Inlinenuxt.config.tsSimple one-off hooks

Project Structure

my-module/├── src/│   ├── module.ts           # Entry point│   └── runtime/            # Injected into user's app│       ├── components/│       ├── composables/│       ├── plugins/│       └── server/├── playground/             # Dev testing└── test/fixtures/          # E2E tests

Resources

來源與署名

來源:onmax/nuxt-skills位於skills/nuxt-modules提交008232b

授權條款: MIT

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架