Va1 / string-replace-loader

Replace loader for Webpack
MIT License
250 stars 57 forks source link

Getting an unexpected token error when trying to process .json files #44

Closed lopugit closed 4 years ago

lopugit commented 6 years ago

I've got some language translation files, I was hoping to parse them but when I include .json in the test regex I get an unexpected token error, you may need an appropriate loader to handle this file type

WARNING in ./src/client/locales/or-IN.json Module parse failed: Unexpected token (2:8) You may need an appropriate loader to handle this file type. | { | "hero": "Ensuring compensation for the creators of value", | "search": "Search", | "search_placeholder": "Search...", @ ./src/client/locales lazy ^\.\/.*$ @ ./src/client/translations/index.js @ ./src/client/index.js @ multi (webpack)-dev-server/client?http://localhost:3456 ./src/client/index.js

dvdtth commented 6 years ago

sounds like you're missing a loader for *.json file types in your webpack config file, add this

{ test: /.json$/, loader: 'json-loader' }

Va1 commented 4 years ago

the above comment indicates the issue. closing this. cheers