Copy files after npm install
The example below shows you how to copy bootstrap files to another folder within your project.
Things to note:
- The library **WILL CREATE DIRECTORIES** for you
- It will output to the console straight after you run
npm i
- The library **WILL NOT** run after installing a specific package
- **DOES NOT** remove files if you update the search strings
STEP 1: install copy-files-from-to
package
npm i -D copy-files-from-to
STEP 2: configure package.json
{
"scripts": {
"postinstall": "copy-files-from-to"
},
"copyFiles":[
{
"from": "node_modules/bootstrap/dist/css/*",
"to": "assets/vendor/bootstrap/css/"
}
]
}
STEP 3: install packages
npm i
See Package Page for more info: https://www.npmjs.com/package/copy-files-from-to