Webpack ES6 babel errors
Webpack build, eslint errors
Hello I am recently writing a front end tool which is very similar to Dreamview although they work differently.
➜ frontend vim webpack.config.js
➜ frontend npm run lint
> [email protected] lint /Users/lei.wang1/Github/RandomMapGenerator/frontend
> eslint --ext .js ./src
/Users/lei.wang1/Github/RandomMapGenerator/frontend/src/app.js
5:8 error 'Scene' is defined but never used no-unused-vars
/Users/lei.wang1/Github/RandomMapGenerator/frontend/src/scene/scene.js
6:1 error Parsing error: Unexpected character '@'
@ ./app.js 15:13-38
ERROR in ./renderer/renderer.js
Module not found: Error: Can't resolve 'settings.yaml' in '/Users/lei.wang1/Github/RandomMapGenerator/frontend/src/renderer'
I used similar dependencies (.eslintrc, generated package.json, webpack.configure.js) as DreamView. But codes cannot build.
Problems specification
After some digging out, it seems that babel-loader is not detected and variable in JSX scripts will not be respected by eslint rules.
- I disabled "no unsued var" rule, but it has no effects on the result
- I added "react/jsx-uses-vars" and "react/jsx-uses-react" warnings, but there is no positive response.
Other details
I followed the code philosophy both from utilities like mobx-react", "imports-name" coding style and apolloauto dreamview itself as far I know. I am webpack.js user. Am I missing any things?
Hi @yiakwy,
May we know how you concluded that "babel-loader is not detected" is the cause? It seems like the eslint ran not through webpack, so webpack plugins weren't applied. However, this is the initial analysis, to investigate more, could you provide more information such as the content in webpack.config.js and package.json?
ERROR in ./renderer/renderer.js Module not found: Error: Can't resolve 'settings.yaml' in '/Users/lei.wang1/Github/RandomMapGenerator/frontend/src/renderer'
For this error, try using yaml-loader/json-loader.
Hi @yiakwy,
hope our answer resolved your issue. Since we haven't heard back from you, I will close the issue for now. If you have any additional question, please feel free to re-open this issue or open a new one. Our engineer team are more than happy to help that.
Thank you for supporting Apollo!