[WIP] Use FontAwesome Component for Vue (#3127)

* wip

* Rename

* Clean up

* Clean up

* wip

* wip

* Enable tree shaking

* ✌️

* ✌️

* wip

* wip

* Clean up
This commit is contained in:
syuilo 2018-11-06 01:40:11 +09:00 committed by GitHub
parent e640dbc501
commit 9f5dc2c0df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
190 changed files with 924 additions and 865 deletions

View file

@ -13,7 +13,6 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin');
import I18nReplacer from './src/misc/i18n';
import { pattern as i18nPattern, replacement as i18nReplacement } from './webpack/i18n';
import { pattern as faPattern, replacement as faReplacement } from './src/misc/fa';
const constants = require('./src/const.json');
const locales = require('./locales');
@ -22,15 +21,11 @@ const version = meta.clientVersion;
const codename = meta.codename;
declare var global: {
faReplacement: typeof faReplacement;
collapseSpacesReplacement: any;
base64replacement: any;
i18nReplacement: typeof i18nReplacement;
};
//#region Replacer definitions
global['faReplacement'] = faReplacement;
global['collapseSpacesReplacement'] = (html: string) => {
return minifyHtml(html, {
collapseWhitespace: true,
@ -39,10 +34,6 @@ global['collapseSpacesReplacement'] = (html: string) => {
}).replace(/\t/g, '');
};
global['base64replacement'] = (_: any, key: string) => {
return fs.readFileSync(`${__dirname}/src/client/${key}`, 'base64');
};
global['i18nReplacement'] = i18nReplacement;
//#endregion
@ -142,15 +133,9 @@ module.exports = {
loader: 'replace',
query: {
qs: [{
search: /%base64:(.+?)%/g.toString(),
replace: 'base64replacement'
}, {
search: i18nPattern.toString(),
replace: 'i18nReplacement',
i18n: true
}, {
search: faPattern.toString(),
replace: 'faReplacement'
}, {
search: /^<template>([\s\S]+?)\r?\n<\/template>/.toString(),
replace: 'collapseSpacesReplacement'
@ -218,9 +203,6 @@ module.exports = {
search: i18nPattern.toString(),
replace: 'i18nReplacement',
i18n: true
}, {
search: faPattern.toString(),
replace: 'faReplacement'
}]
}
}]