From e68767cf02c019fd5ebe4fe01d92c839932b354b Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 8 Dec 2017 02:48:21 +0900 Subject: [PATCH] Refactor --- webpack/module/rules/i18n.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/webpack/module/rules/i18n.ts b/webpack/module/rules/i18n.ts index 873e08e1a..aa4e58448 100644 --- a/webpack/module/rules/i18n.ts +++ b/webpack/module/rules/i18n.ts @@ -32,17 +32,14 @@ export default (lang, locale) => { exclude: /node_modules/, loader: StringReplacePlugin.replace({ replacements: [{ - pattern: /"%i18n:(.+?)%"/g, replacement: (_, key) => { - return '"' + get(key).replace(/"/g, '\\"') + '"'; - } + pattern: /"%i18n:(.+?)%"/g, replacement: (_, key) => + '"' + get(key).replace(/"/g, '\\"') + '"' }, { - pattern: /'%i18n:(.+?)%'/g, replacement: (_, key) => { - return '\'' + get(key).replace(/'/g, '\\\'') + '\''; - } + pattern: /'%i18n:(.+?)%'/g, replacement: (_, key) => + '\'' + get(key).replace(/'/g, '\\\'') + '\'' }, { - pattern: /%i18n:(.+?)%/g, replacement: (_, key) => { - return get(key); - } + pattern: /%i18n:(.+?)%/g, replacement: (_, key) => + get(key) }] }) };