module-builder
module-builder copied to clipboard
Programmatically use
If i try import package import { buildModule } from '@nuxt/module-builder';, i get this error
No "exports" main defined in .../node_modules/@nuxt/module-builder/package.json
Can you add exports or main to package.json?
What is your purpose of using it programmatically?
We create library with multiple nuxt-modules, for this i create scripts for prebuild/build this modules.
Now i use exec from child_process
exec(`nuxt-module-build ${modulePath} --stub`)
We are planning to work on a unified CLI toolkit. I think with that exposing a standard programmatic API would be easily possible! In the meantime, using exec (or execa) is probably the best!