module-builder icon indicating copy to clipboard operation
module-builder copied to clipboard

Programmatically use

Open Kolobok12309 opened this issue 3 years ago • 3 comments

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?

Kolobok12309 avatar May 12 '22 10:05 Kolobok12309

What is your purpose of using it programmatically?

atinux avatar May 23 '22 10:05 atinux

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`)

Kolobok12309 avatar May 23 '22 13:05 Kolobok12309

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!

pi0 avatar May 31 '22 20:05 pi0