This commit is contained in:
syuilo 2018-05-17 18:18:45 +09:00
parent cf0351225f
commit d253df4574
4 changed files with 8 additions and 11 deletions

View file

@ -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",

View file

@ -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;

View file

@ -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

View file

@ -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;
};
}