I want to run simple NPM script to minimize JS, CSS and put all assets into build
folder. The script looks like this and is supposed to be ran from root directory:
mkdir -p build/assets/{js,css,images} && npm run minify-js && npm run minify-css && npm run copy-img && npm run copy-html
However, when running on npm run build
on Netlify, I get an error that the directory where minified files should be put to does not exist:
10:35:46 PM: > uglifyjs --compress --mangle -- assets/js/main.js > build/assets/js/main.js
10:35:46 PM: sh: 1: cannot create build/assets/js/main.js: Directory nonexistent
I tested the same script locally and it works without issues. Why is that?