Skip to content

Commit

Permalink
Merge branch 'release/1.0.16'
Browse files Browse the repository at this point in the history
  • Loading branch information
alienfast-build committed Apr 30, 2018
2 parents 3bcdb7d + ac7348f commit f969409
Show file tree
Hide file tree
Showing 4 changed files with 882 additions and 1,152 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Applications that reuse libraries e.g. white labeling, can utilize one to many s
the app will override.

```javascript
{overrides: ['../node_modules/lib1/locales']}
{overrides: ['../node_modules/lib1/locales']} // relative or absolute paths
```
This configures the loader to work on a file structure like the following:

Expand Down
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ module.exports = function () {
}

// needs to be ordered in least specialized to most e.g. lib locale -> app locale
const moduleLocalesDirs = options.overrides.map(override => path.join(appLocalesDir, override))
const moduleLocalesDirs = options.overrides.map(override => {
if(path.isAbsolute(override)){
return override
} else {
return path.join(appLocalesDir, override)
}
})
moduleLocalesDirs.push(appLocalesDir)
moduleLocalesDirs.forEach((localesDir) => {
// all subdirectories match language codes
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alienfast/i18next-loader",
"version": "1.0.15",
"version": "1.0.16",
"description": "Webpack loader for client embedded i18next locales from json or yaml.",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -38,11 +38,11 @@
"glob-all": "^3.1.0",
"js-yaml": "^3.11.0",
"loader-utils": "^1.1.0",
"lodash": "^4.17.5"
"lodash": "^4.17.10"
},
"devDependencies": {
"@alienfast/build": "^4.0.18",
"@alienfast/build": "^4.0.108",
"chai": "^4.1.2",
"mocha": "^5.0.5"
"mocha": "^5.1.1"
}
}
Loading

0 comments on commit f969409

Please sign in to comment.