I have read the document of build library in VUE-CLI3.0. My directory:
--src
--components
--componentA.vue
--componentB.vue
....
--componentZ.vue
--build
--libs.js
I want to run one command with my one entry "libs.js" (Maybe there is a loop to create multiple entries in libs.js) to bundle my components separately. The destination folder maybe like the following:
--dist
--componentA.css
--componentA.command.js
--componentA.umd.js
--componentA.umd.min.js
...
--componentZ.css
--componentZ.command.js
--componentZ.umd.js
--componentZ.umd.min.js
Can anyone give me some suggetions?
I add a script file. In which, I get the list of components and using 'child_process' to execute each command. The following is an example:
lib.js
What's more, add a script command in package.json:
"build-all": "node ./src/build/lib.js"
You just enter
npm run build-all
. That's all~