mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-15 09:44:27 +02:00
Refactor.
This commit is contained in:
@@ -1,32 +1,5 @@
|
||||
// const {jq} = require('./globals');
|
||||
// const config = require('./config');
|
||||
//
|
||||
// const name = jq('script[data-module]').data('module');
|
||||
// const query = {
|
||||
// action: 'get',
|
||||
// setup: true,
|
||||
// options: true,
|
||||
// types: true
|
||||
// };
|
||||
//
|
||||
// if (name === 'index') {
|
||||
// query.theme = true;
|
||||
// query.langs = true;
|
||||
// } else if (name === 'info') {
|
||||
// query.refresh = true;
|
||||
// } else {
|
||||
// throw new Error(`no-main-module: '${name}'`);
|
||||
// }
|
||||
//
|
||||
// config._update(query).then(() => {
|
||||
// jq(() => require(`./main/${name}`));
|
||||
// });
|
||||
|
||||
module.exports = (deps = {}) => {
|
||||
const {
|
||||
jq = require('./globals').jq,
|
||||
config = require('./config')
|
||||
} = deps;
|
||||
const {jq} = require('./globals');
|
||||
const config = require('./config');
|
||||
|
||||
const name = jq('script[data-module]').data('module');
|
||||
const query = {
|
||||
@@ -45,7 +18,4 @@ module.exports = (deps = {}) => {
|
||||
throw new Error(`no-main-module: '${name}'`);
|
||||
}
|
||||
|
||||
config._update(query).then(() => {
|
||||
jq(() => require(`./main/${name}`));
|
||||
});
|
||||
};
|
||||
config._update(query).then(() => jq(() => require(`./main/${name}`)));
|
||||
|
@@ -1,2 +1 @@
|
||||
const init = require('./lib/init');
|
||||
init();
|
||||
require('./lib/init');
|
||||
|
Reference in New Issue
Block a user