Skip to content

Latest commit

 

History

History

plugin-utils

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

plugin-utils

npm npm (scoped with tag)

A helper package for nuxt plugins

Available features:

Logging

If your nuxt plugin writes output (during build) you should import the log and/or error methods. Errors are printed in red and normal logs in purple. It is recommended to use your plugin's package name as the log identifier so users will know from which plugin the message originated.

These log methods are replaced with noop handlers for production builds.

Usage

module.exports.meta = require('./package.json')
const log = require('@nuxtjs/plugin-utils').log(module.exports.meta.name)
const error = require('@nuxtjs/plugin-utils').error(module.exports.meta.name)

log('information about what the plugin is doing during build') // printed in purple
error('oops, something went wrong') // printed in red