From d253df4574a899b24ec34cbcf73096ab3faac7e1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 17 May 2018 18:18:45 +0900 Subject: [PATCH] :v: --- package.json | 2 +- src/build/fa.ts | 5 +---- webpack.config.ts | 4 ++-- webpack/loaders/replace.js | 8 ++++---- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 6edc7c5be9..0d9646acce 100644 --- a/package.json +++ b/package.json @@ -209,7 +209,7 @@ "vue-cropperjs": "2.2.0", "vue-js-modal": "1.3.13", "vue-json-tree-view": "2.1.4", - "vue-loader": "15.0.11", + "vue-loader": "15.0.5", "vue-router": "3.0.1", "vue-template-compiler": "2.5.16", "vuedraggable": "2.16.0", diff --git a/src/build/fa.ts b/src/build/fa.ts index f6f2427d0a..111c19ae66 100644 --- a/src/build/fa.ts +++ b/src/build/fa.ts @@ -7,10 +7,7 @@ import * as regular from '@fortawesome/fontawesome-free-regular'; import * as solid from '@fortawesome/fontawesome-free-solid'; import * as brands from '@fortawesome/fontawesome-free-brands'; -// Add icons -fontawesome.library.add(regular); -fontawesome.library.add(solid); -fontawesome.library.add(brands); +fontawesome.library.add(regular, solid, brands); export const pattern = /%fa:(.+?)%/g; diff --git a/webpack.config.ts b/webpack.config.ts index b2f67c914f..d56ed23972 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -110,14 +110,14 @@ const plugins = [ //#region i18n langs.forEach(lang => { Object.keys(entry).forEach(file => { - let src = fs.readFileSync(`${__dirname}/built/client/assets/${file}.${version}.-.${isProduction ? 'min' : 'raw'}.js`, 'utf8'); + let src = fs.readFileSync(`${__dirname}/built/client/assets/${file}.${version}.-.${isProduction ? 'min' : 'raw'}.js`, 'utf-8'); const i18nReplacer = new I18nReplacer(lang); src = src.replace(i18nReplacer.pattern, i18nReplacer.replacement); src = src.replace('%lang%', lang); - fs.writeFileSync(`${__dirname}/built/client/assets/${file}.${version}.${lang}.${isProduction ? 'min' : 'raw'}.js`, src, 'utf8'); + fs.writeFileSync(`${__dirname}/built/client/assets/${file}.${version}.${lang}.${isProduction ? 'min' : 'raw'}.js`, src, 'utf-8'); }); }); //#endregion diff --git a/webpack/loaders/replace.js b/webpack/loaders/replace.js index 0326dcdab3..d8a81c245a 100644 --- a/webpack/loaders/replace.js +++ b/webpack/loaders/replace.js @@ -1,12 +1,12 @@ -const loaderUtils = require('loader-utils'); +import { getOptions } from 'loader-utils'; function trim(text, g) { return text.substring(1, text.length - (g ? 2 : 0)); } -module.exports = function(src) { +export default function(src) { this.cacheable(); - const options = loaderUtils.getOptions(this); + const options = getOptions(this); const search = options.search; const g = search[search.length - 1] == 'g'; const file = this.resourcePath.replace(/\\/g, '/'); @@ -19,4 +19,4 @@ module.exports = function(src) { src = src.replace(new RegExp(trim(search, g), g ? 'g' : ''), replace); this.callback(null, src); return src; -}; +}