@alienfast/i18next-loader
Advanced tools
Comparing version 1.0.11 to 1.0.12
15
index.js
@@ -30,3 +30,9 @@ const path = require('path') | ||
const appLocalesDir = path.dirname(this.resource) // this is the absolute path to the index.js in the top level locales dir | ||
if (!fs.existsSync(appLocalesDir)) { | ||
throw new Error('Directory does not exist: ' + appLocalesDir + ' for resource: ' + this.resource) | ||
} | ||
let appResBundle = {} | ||
if (options.debug) { | ||
console.info("Bundling locales from " + appLocalesDir + ' (ordered least specific to most):') | ||
} | ||
@@ -51,2 +57,5 @@ // needs to be ordered in least specialized to most e.g. lib locale -> app locale | ||
this.addDependency(fullPath) | ||
if (options.debug) { | ||
console.info("\t" + fullPath) | ||
} | ||
@@ -73,3 +82,7 @@ const fileContent = fs.readFileSync(fullPath) | ||
}) | ||
return 'module.exports = ' + JSON.stringify(appResBundle) | ||
const bundle = JSON.stringify(appResBundle) | ||
if (options.debug) { | ||
console.info("Final locales bundle: \n" + bundle) | ||
} | ||
return 'module.exports = ' + bundle | ||
} |
{ | ||
"name": "@alienfast/i18next-loader", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Webpack loader for client embedded i18next locales from json or yaml.", | ||
@@ -44,6 +44,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@alienfast/build": "^2.0.138", | ||
"@alienfast/build": "^3.0.17", | ||
"chai": "^4.1.2", | ||
"mocha": "^4.0.1" | ||
"mocha": "^4.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
251899
247