mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 15:15:12 +00:00
✌️
This commit is contained in:
parent
cf0351225f
commit
d253df4574
4 changed files with 8 additions and 11 deletions
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue