diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-15 02:51:29 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-15 02:51:29 +0900 |
| commit | 986780a39a1ae83cdcae1874ae0d29e7d2cd0cdc (patch) | |
| tree | 1234fb8647a0c462058b45ff6807ccc9d6b5479c /webpack/loaders | |
| parent | wip (diff) | |
| download | sharkey-986780a39a1ae83cdcae1874ae0d29e7d2cd0cdc.tar.gz sharkey-986780a39a1ae83cdcae1874ae0d29e7d2cd0cdc.tar.bz2 sharkey-986780a39a1ae83cdcae1874ae0d29e7d2cd0cdc.zip | |
wip
Diffstat (limited to 'webpack/loaders')
| -rw-r--r-- | webpack/loaders/replace.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/webpack/loaders/replace.js b/webpack/loaders/replace.js index 8018e9cec2..9897fe37d5 100644 --- a/webpack/loaders/replace.js +++ b/webpack/loaders/replace.js @@ -10,9 +10,9 @@ module.exports = function(src) { const search = options.search; const g = search[search.length - 1] == 'g'; const file = this.resourcePath.replace(/\\/g, '/'); - const replace = global[options.replace].bind(null, { + const replace = options.i18n ? global[options.replace].bind(null, { src: file - }); + }) : global[options.replace]; if (typeof search != 'string' || search.length == 0) console.error('invalid search'); if (typeof replace != 'function') console.error('invalid replacer:', replace, this.request); src = src.replace(new RegExp(trim(search, g), g ? 'g' : ''), replace); |