$ cnpm install nuxt-module-builder
????️ Nuxt Standard Module Builder
nuxt.module.config.js
fileJust head to nuxt-community/module-template to make your fresh module in few minutes.
Edit package.json like this:
{
"scripts": {
"build": "nuxt-module"
},
"devDependencies": {
"nuxt-module-builder": "latest"
}
}
Create src/index.js file:
export default async function (moduleOptions) {
// ...
}
Optionally add a moduleBuilder
section in package.json or create nuxt.module.config.js in the root of module project to customize module builder:
module.exports = {
meta: {
name: 'myModule'
},
plugins: [
// rollup plugins
]
}
You can now use npm run nuxt-module
to generate dist/index.js
For watch mode, you can use nuxt-module --watch
TODO
Copyright (c) 2017 Nuxt.js
Copyright 2014 - 2017 © taobao.org |