angular-translate-loader
angular-translate-loader copied to clipboard
Webpack 4 single line config issued
In Webpack 4 I trying use single line config Like below
var translations = require('!json!angular-translate?module=translations!./index.json');
console.log(translations); // Object { foo: "bar", bar: { baz: "qux" } }
but i will got
SyntaxError: Unexpected token v in JSON at position 0
at JSON.parse (
According Webpack document , json-loader is not required anymore refer : https://webpack.js.org/migrate/3/#json-loader-is-not-required-anymore so i remove json from require , like this . Is work for me
var translations = require('!angular-translate?module=translations!./index.json');
console.log(translations); // Object { foo: "bar", bar: { baz: "qux" } }