Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack.config.js中使用Rest/Spread Properties语法,导致vscode eslint的import语法报错 #92

Open
LingYanSi opened this issue Dec 26, 2017 · 0 comments

Comments

@LingYanSi
Copy link
Owner

LingYanSi commented Dec 26, 2017

参考: eslint-import-resolver-webpack don't work for resolved paths #352

简单来说eslint -> eslint-plugin-import -> eslint-import-resolver-webpack在解析webpack.config.js时只支持es5语法。
Rest/Spread Properties不属于es5/es2015/es2016/es2017,而是一个尚在提案中的特性。
image

解决方案:
使用webpack.config.babel.js作为webpack配置文件,这样在读取配置文件的时候,会先被babel转译。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant