Installation
Package Installation
Choose your preferred package manager:
bash
npm install @opto-code/nuxt-dev-consolebash
yarn add @opto-code/nuxt-dev-consolebash
pnpm add @opto-code/nuxt-dev-consoleModule Setup
Add the module to your nuxt.config.ts:
ts
export default defineNuxtConfig({
modules: ['@opto-code/nuxt-dev-console'],
devConsole: {
enabled: true
}
})Development vs Production
By default, the console is only enabled in development mode. To enable it in production:
ts
export default defineNuxtConfig({
modules: ['@opto-code/nuxt-dev-console'],
devConsole: {
enabled: true,
allowProduction: true // Enable in production
}
})WARNING
Enabling the console in production should be done with caution as it may expose sensitive debugging information.
TypeScript Support
The module includes full TypeScript support out of the box. No additional setup is required.
Verification
To verify the installation:
- Start your development server:
bash
npm run dev- Open your browser's console
- You should see the initialization message:
[DevLogger] Initialized and available globally as window.$devLoggerTroubleshooting
If you encounter any issues:
- Ensure you're using Nuxt 3
- Check your Node.js version (16.x or later required)
- Clear your node_modules and reinstall dependencies
- Verify the module is listed in your
nuxt.config.ts
Next Steps
- Continue to the Quick Start Guide
- Learn about Configuration Options
- Explore Advanced Features
