0

I have old js script that need improvements. I want to write code in es6 style with babeljs compile it to es5 standard with minify in wepback3. How to set webpack to only parse files, save them in another dir and not bundle them?

0

1 Answer 1

1

Webpack is, by definition, a module bundler - while it might be possible to use plugins to hack it into doing a file-by-file copy, I wouldn't advise it.

Instead, use the Babel CLI directly - it will individual files or entire directories depending on what you pass into it. It also has a --minfied option that will minify the output for you, without having to manually pipe the files into UglifyJS.

./node_modules/.bin/babel src --out-dir build --minified

Not the answer you're looking for? Browse other questions tagged or ask your own question.