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
distanddist/assetsfolders. - Concatenate several JavaScript files and save to
dist/background-dist.js. - Copy
assets/*.pngfiles todist/assets/. - Copy several other files.
Here is the source file:
JS
build.js
Finally, add the script to package.json:
JSON
package.json
Read next
Note: I'll soon be sharing short, practical tips on Angular — a good way to pick up something new if you're interested.