Custom build script in Node.js
For simple build tasks in Node.js I use a custom script. Let’s consider the following requirements:
- Create the
dist
anddist/assets
folders. - Concatenate several JavaScript files and save to
dist/background-dist.js
. - Copy
assets/*.png
files todist/assets/
. - Copy several other files.
Here is the source file:
JS
build.js
Finally, add the script to package.json
:
JSON
package.json