fix: babel-loader work incorrectly with .babelrc #392
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #384
问题产生原因是3.5.0中引用了copy-text-to-clipboard,问题代码在31行,catch块没有携带参数。
这种写法是es2019的提案,babel7已经支持@babel/plugin-proposal-optional-catch-binding
在相对老的项目中,比如vue-cli2生成的项目,其中的babel还处在babel6,遇到这种代码便会报错。
根据官网所说,
@babel/preset-env
已经预置了@babel/plugin-proposal-optional-catch-binding
插件本项目使用的也是babel7+@babel/preset-env,但是编译出来的代码却还是
最重搜索得知
babel-loader
好像并不是默认加载.babelrc
中的配置,issue1,issue2