Use Webpack to output es6?

后端 未结 2 2222
梦如初夏
梦如初夏 2021-02-14 10:17

Is there a way to use Webpack to bundle all the JavaScript files and output the resulting bundle.js as an es6 file, and not to es5? So, it is Webpack\'s job to bundle, but is it

2条回答
  •  旧时难觅i
    2021-02-14 10:44

    Webpack still can't do this. There is an open ticket here https://github.com/webpack/webpack/issues/2933

    For now, if you want to bundle es6 the most promising solution seems to be rollup

    This article is also linked in the discussion on GitHub and provides a pretty good overview

    https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c

提交回复
热议问题