Bring Vite's CLI shortcuts feature to Nuxt.
nuxt-module-cli-shortcuts
dependency to your projectnpx nuxi module add nuxt-module-cli-shortcuts
nuxt-module-cli-shortcuts
to the modules
section of nuxt.config.ts
export default defineNuxtConfig({
modules: [
'nuxt-module-cli-shortcuts',
],
shortcuts: {
rawMode: true,
customShortcuts: []
}
})
Whether to enable stdin raw mode. It may cause some problems.
When disable it , every shortcuts needs to be followed with an Enter press to execute it.
customShortcuts: [
{
key: 't',
description: 'test custom shortcuts',
action({ nuxt }) {
console.log('Nuxt Instance', nuxt)
}
}
]
You can refer built-in shortcuts to learn more.
# 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
Inspired by