mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
bug fix
This commit is contained in:
1 parent
2b6a510c1e
commit
f2bcc3bc93
23 files changed
+241
-119
No files matched your search
+7
-11
@@ -25,18 +25,15 @@ async function build(type) {
|
||||
ignoreFailure(fs.mkdirSync, root('.build'));
|
||||
ignoreFailure(fs.mkdirSync, root('.build/module'));
|
||||
const langs = fs.readdirSync(root('locales'));
|
||||
const lang = {};
|
||||
const locale = {};
|
||||
for (const i of langs) {
|
||||
const content = fs.readFileSync(root(`locales/${i}`)).toString();
|
||||
lang[i.split('.')[0]] = yaml.safeLoad(content);
|
||||
locale[i.split('.')[0]] = yaml.safeLoad(content);
|
||||
}
|
||||
const exclude = [
|
||||
'bsod.html',
|
||||
];
|
||||
const builtin = {
|
||||
id: 'builtin',
|
||||
locale: lang,
|
||||
template: template('templates', exclude),
|
||||
locale,
|
||||
template: template('templates'),
|
||||
file: {},
|
||||
};
|
||||
const files = getFiles('.uibuild');
|
||||
@@ -72,10 +69,9 @@ async function build(type) {
|
||||
console.error(`Module pack failed: ${m}`);
|
||||
}
|
||||
}
|
||||
await fsp.writeFile(root('.build/module.json'), JSON.stringify(j));
|
||||
console.log('Build::Full');
|
||||
await require('./webpack')(type, '-full');
|
||||
await fsp.unlink(root('.build/module.json'));
|
||||
const f = fs.readFileSync(root('.build/development.js')).toString();
|
||||
const file = `global._hydroModule=${JSON.stringify(j)};${f}`;
|
||||
fs.writeFileSync(root('.build/full.js'), file);
|
||||
}
|
||||
|
||||
module.exports = build;
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ function getFiles(folder) {
|
||||
return files;
|
||||
}
|
||||
|
||||
const build = (dirOrObject, exclude = []) => {
|
||||
const build = (dirOrObject) => {
|
||||
let templates = {};
|
||||
if (typeof dirOrObject === 'string') {
|
||||
const files = getFiles(dirOrObject);
|
||||
@@ -25,7 +25,7 @@ const build = (dirOrObject, exclude = []) => {
|
||||
}
|
||||
} else templates = dirOrObject;
|
||||
for (const i in templates) {
|
||||
if (!exclude.includes(i) && i.endsWith('.html')) {
|
||||
if (i.endsWith('.html') && !templates[i].includes('No Compression')) {
|
||||
templates[i] = templates[i]
|
||||
.trim()
|
||||
.replace(/ *\n */gmi, ' ')
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ const webpack = require('webpack');
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
|
||||
const { root } = require('./utils');
|
||||
|
||||
const build = async (type, tag = '') => {
|
||||
const build = async (type) => {
|
||||
function hackNodeModuleFormidable() {
|
||||
const tasks = ['incoming_form', 'file', 'json_parser', 'querystring_parser'];
|
||||
for (const task of tasks) {
|
||||
@@ -25,7 +25,7 @@ const build = async (type, tag = '') => {
|
||||
development: root('hydro/development.js'),
|
||||
},
|
||||
output: {
|
||||
filename: `[name]${tag}.js`,
|
||||
filename: '[name].js',
|
||||
path: root('.build'),
|
||||
},
|
||||
target: 'node',
|
||||
|
||||
Reference in new issue
Block a user