Fix intl-loader, that was broken after json-loader update

This commit is contained in:
SleepWalker 2017-08-01 20:31:47 +03:00
parent 6b3f1037be
commit b181142d5b
2 changed files with 4 additions and 4 deletions

View File

@ -1,12 +1,12 @@
module.exports = function() {
module.exports = function(content) {
this.cacheable && this.cacheable();
content = JSON.parse(content);
var moduleId = this.context
const moduleId = this.context
.replace(this.options.resolve.root, '')
.replace(/^\/|\/$/g, '')
.replace(/\//g, '.');
var content = this.inputValue[0];
content = JSON.stringify(Object.keys(content).reduce(function(translations, key) {
translations[key] = {
id: moduleId + '.' + key,

View File

@ -178,7 +178,7 @@ const webpackConfig = {
},
{
test: /\.intl\.json$/,
loader: 'babel!intl!json'
loader: 'babel!intl'
},
{
test: /\.font\.(js|json)$/,