Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Webpack has odd behavior when used with babel-loader and trying to bundle json files. #4411
Do you want to request a feature or report a bug?
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
All of them involve a single js file that requires in a JSON file.
some.json (taken from webpack test)
The following webpack.config.js fails
whereas this works just fine (doesn't use path.resolve for paths)
and this works too (doesn't use babel-loader)
To see the behavior, clone the repo referenced above, then
What is the expected behavior?
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
An update, it appears that NOT using path.resolve for the babel loader (test 2 above) causes it to not run (e.g. React syntax isn't understood). This makes me think that the conflict lies in the babel-loader and loading of json as both "working" configurations don't make use of babel-loader.
Should this issue be opened in the babel-loader repo instead?