angular-translate-loader icon indicating copy to clipboard operation
angular-translate-loader copied to clipboard

Webpack 4 single line config issued

Open a9261 opened this issue 6 years ago • 0 comments

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 () at Object.module.exports (F:\NewWork\Legal_Webv4\node_modules\json-loader\index.js:4:49)

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" } }

a9261 avatar Jul 10 '18 05:07 a9261