In a nodejs
express.js
application, and trying to build the app using babel
for cross browser compatibility.
package.json
scripts:
"scripts": {
"start": "node dist/app.js",
"build": "babel src -d dist"
}
On running npm build
and check my build folder everything builds correctly except my non-js files like [.html,.css,.ejs]. At the moment just copied those file to the build folder in their respective sub directories and everything works fine.
I have even tried
"build": "babel src -d dist --ignore *.css,*.ejs,*.png,*.jpg"
Is there a way to do this in a better way instead of copying the non-js files. Thanks in advance any help will be highly appreciated.
--ignore *.css,*.html,*.ejs
should work. babeljs.io/docs/en/babel-cli#ignore-files – mattdevio Sep 16 '18 at 17:38--ignore
flag keeps the given files out of the build. That isn't what you want. You might try the--copy-files
flag though. – Adam Sep 16 '18 at 17:57