Custom build script in Node.js

Custom build script in Node.js

For simple build tasks in Node.js I use a custom script. Let’s consider the following requirements:

  1. Create the dist and dist/assets folders.
  2. Concatenate several JavaScript files and save to dist/background-dist.js.
  3. Copy assets/*.png files to dist/assets/.
  4. Copy several other files.

Here is the source file:

JS
build.js

Finally, add the script to package.json:

JSON
package.json

Leave a Reply

avatar
  Subscribe  
Notify of