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
0 0 votes
Article Rating

Want more?

Share!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x