I have been struggling to create a clean
npm script that works properly. Every time I try, I either encounter an error in the console or the intended outcome doesn't occur. My goal is to remove all root JavaScript files except for certain config files.
The code below deletes all files without using negate syntax:
"clean": "rm -rf lib [a-z].js !*.config.js !*.support.js"
However, the following code results in a console error:
"clean": "rm -rf lib !(*.config|*.support).js"
Syntax error: "(" unexpected