First, be sure you have the following content in your package.json
, very basic source-to-destination kinda stuff.
{
"static": {
"paths": [
{
"src": "src/assets",
"dest": "dist/assets"
}
]
}
}
Second, you should install these two packages as devDependencies
with npm.
npm i chokidar ncp -D
chokidar for watching files and folders, ncp for copying stuffs around.
You can use it with CLI like:
node copy-static-folder.js
or use it in npm scripts:
package.json
{
"scripts": {
"copy-static": "node copy-static-folder.js"
}
}
npm run copy-static
node copy-static-folder.js build