Using node and npm and as a task runner from gitbash cli. I have set up and tested, all works well for the most part. The problem I am having is I cannot seem to call tasks in separate .js files from my package.json. Could I have some assistance with the syntax please.
concat-css.js is in the same folder as package.json.
My task:
var concat = require('concatenate-files');
concat('deploy/css/min/*.css', 'deploy/css/css.css', { separator: ';' }, function(err, result) {
// result == { outputFile: 'out.js', outputData: '...' }
});
The script from package.json:
"scripts": {"concat-css": "npm run concat"}
The dependency concatenate-files is installed and a local and global dependency:
"devDependencies": {"concatenate-files": "^0.1.1"}
"dependencies": {"concatenate-files": "^0.1.1"}
But I get this error when I run the task:
npm run concat-css
npm ERR! missing script: concat
I honestly can't work out whats wrong and have hit a dead end. The resources online for npm are a bit patchy. Can anyone point me in the right direction. The duplicate question flagged is too general and would not have helped me.