refactor: async
This commit is contained in:
parent
18bb7b961b
commit
73f36ab3c0
|
@ -2,13 +2,18 @@ const neutrino = require('neutrino');
|
||||||
|
|
||||||
const R = require('../bootstrap/require');
|
const R = require('../bootstrap/require');
|
||||||
const {targetNeutrino} = require('../server/commands');
|
const {targetNeutrino} = require('../server/commands');
|
||||||
|
const D = require('../debug');
|
||||||
const {default: Flecks} = require('../server/flecks');
|
const {default: Flecks} = require('../server/flecks');
|
||||||
|
|
||||||
|
const debug = D('@flecks/core/.eslintrc.js');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
FLECKS_CORE_BUILD_TARGET = 'fleck',
|
FLECKS_CORE_BUILD_TARGET = 'fleck',
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
|
debug('bootstrapping flecks...');
|
||||||
const flecks = Flecks.bootstrap();
|
const flecks = Flecks.bootstrap();
|
||||||
|
debug('bootstrapped');
|
||||||
|
|
||||||
const config = R(process.env[targetNeutrino(FLECKS_CORE_BUILD_TARGET)]);
|
const config = R(process.env[targetNeutrino(FLECKS_CORE_BUILD_TARGET)]);
|
||||||
flecks.invokeFlat('@flecks/core/build', FLECKS_CORE_BUILD_TARGET, config);
|
flecks.invokeFlat('@flecks/core/build', FLECKS_CORE_BUILD_TARGET, config);
|
||||||
|
|
|
@ -29,9 +29,11 @@ const buildList = FLECKS_CORE_BUILD_LIST
|
||||||
.map((name) => name.trim())
|
.map((name) => name.trim())
|
||||||
.filter((e) => e);
|
.filter((e) => e);
|
||||||
|
|
||||||
|
export default (async () => {
|
||||||
|
debug('bootstrapping flecks...');
|
||||||
const flecks = Flecks.bootstrap();
|
const flecks = Flecks.bootstrap();
|
||||||
|
debug('bootstrapped');
|
||||||
|
|
||||||
const buildConfigs = async () => {
|
|
||||||
debug('gathering configs');
|
debug('gathering configs');
|
||||||
let targets = flatten(flecks.invokeFlat('@flecks/core/targets'));
|
let targets = flatten(flecks.invokeFlat('@flecks/core/targets'));
|
||||||
if (buildList.length > 0) {
|
if (buildList.length > 0) {
|
||||||
|
@ -68,6 +70,4 @@ const buildConfigs = async () => {
|
||||||
await new Promise(() => {});
|
await new Promise(() => {});
|
||||||
}
|
}
|
||||||
return webpackConfigs;
|
return webpackConfigs;
|
||||||
};
|
})();
|
||||||
|
|
||||||
export default buildConfigs();
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ else {
|
||||||
const program = new Command();
|
const program = new Command();
|
||||||
program.enablePositionalOptions();
|
program.enablePositionalOptions();
|
||||||
// Bootstrap.
|
// Bootstrap.
|
||||||
|
(async () => {
|
||||||
debug('bootstrapping flecks...');
|
debug('bootstrapping flecks...');
|
||||||
const flecks = Flecks.bootstrap();
|
const flecks = Flecks.bootstrap();
|
||||||
debug('bootstrapped');
|
debug('bootstrapped');
|
||||||
|
@ -106,4 +107,5 @@ else {
|
||||||
}
|
}
|
||||||
// Parse commandline.
|
// Parse commandline.
|
||||||
program.parse(process.argv);
|
program.parse(process.argv);
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import D from 'debug';
|
const D = require('debug');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
VSCODE_INSPECTOR_OPTIONS,
|
VSCODE_INSPECTOR_OPTIONS,
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
let hasInitialized;
|
let hasInitialized;
|
||||||
export default (name) => {
|
module.exports = (name) => {
|
||||||
if (!hasInitialized) {
|
if (!hasInitialized) {
|
||||||
// VSCode has a problem showing colors when formatting objects.
|
// VSCode has a problem showing colors when formatting objects.
|
||||||
if (VSCODE_INSPECTOR_OPTIONS) {
|
if (VSCODE_INSPECTOR_OPTIONS) {
|
||||||
|
|
|
@ -5,16 +5,18 @@ const {join} = require('path');
|
||||||
const banner = require('@neutrinojs/banner');
|
const banner = require('@neutrinojs/banner');
|
||||||
const copy = require('@neutrinojs/copy');
|
const copy = require('@neutrinojs/copy');
|
||||||
|
|
||||||
module.exports = require('@flecks/fleck/server/build/fleck.neutrinorc');
|
module.exports = (async () => {
|
||||||
|
// eslint-disable-next-line global-require
|
||||||
|
const config = await require('@flecks/fleck/server/build/fleck.neutrinorc');
|
||||||
|
|
||||||
module.exports.use.push(banner({
|
config.use.push(banner({
|
||||||
banner: '#!/usr/bin/env node',
|
banner: '#!/usr/bin/env node',
|
||||||
include: /^cli\.js$/,
|
include: /^cli\.js$/,
|
||||||
pluginId: 'shebang',
|
pluginId: 'shebang',
|
||||||
raw: true,
|
raw: true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
module.exports.use.push(({config}) => {
|
config.use.push(({config}) => {
|
||||||
config
|
config
|
||||||
.plugin('executable')
|
.plugin('executable')
|
||||||
.use(class Executable {
|
.use(class Executable {
|
||||||
|
@ -32,7 +34,7 @@ module.exports.use.push(({config}) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.use.push(
|
config.use.push(
|
||||||
copy({
|
copy({
|
||||||
copyUnmodified: true,
|
copyUnmodified: true,
|
||||||
patterns: [
|
patterns: [
|
||||||
|
@ -43,3 +45,7 @@ module.exports.use.push(
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return config;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
|
@ -5,16 +5,18 @@ const {join} = require('path');
|
||||||
const banner = require('@neutrinojs/banner');
|
const banner = require('@neutrinojs/banner');
|
||||||
const copy = require('@neutrinojs/copy');
|
const copy = require('@neutrinojs/copy');
|
||||||
|
|
||||||
module.exports = require('@flecks/fleck/server/build/fleck.neutrinorc');
|
module.exports = (async () => {
|
||||||
|
// eslint-disable-next-line global-require
|
||||||
|
const config = await require('@flecks/fleck/server/build/fleck.neutrinorc');
|
||||||
|
|
||||||
module.exports.use.push(banner({
|
config.use.push(banner({
|
||||||
banner: '#!/usr/bin/env node',
|
banner: '#!/usr/bin/env node',
|
||||||
include: /^cli\.js$/,
|
include: /^cli\.js$/,
|
||||||
pluginId: 'shebang',
|
pluginId: 'shebang',
|
||||||
raw: true,
|
raw: true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
module.exports.use.push(({config}) => {
|
config.use.push(({config}) => {
|
||||||
config
|
config
|
||||||
.plugin('executable')
|
.plugin('executable')
|
||||||
.use(class Executable {
|
.use(class Executable {
|
||||||
|
@ -32,7 +34,7 @@ module.exports.use.push(({config}) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.use.push(
|
config.use.push(
|
||||||
copy({
|
copy({
|
||||||
copyUnmodified: true,
|
copyUnmodified: true,
|
||||||
patterns: [
|
patterns: [
|
||||||
|
@ -43,3 +45,7 @@ module.exports.use.push(
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return config;
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {execSync, spawn} from 'child_process';
|
import {exec, spawn} from 'child_process';
|
||||||
import {mkdir} from 'fs/promises';
|
import {mkdir} from 'fs/promises';
|
||||||
import {tmpdir} from 'os';
|
import {tmpdir} from 'os';
|
||||||
import {join} from 'path';
|
import {join} from 'path';
|
||||||
|
@ -7,23 +7,25 @@ import {D} from '@flecks/core';
|
||||||
|
|
||||||
const debug = D('@flecks/docker/container');
|
const debug = D('@flecks/docker/container');
|
||||||
|
|
||||||
const containerIsRunning = (name) => {
|
const containerIsRunning = async (name) => (
|
||||||
try {
|
new Promise((r, e) => {
|
||||||
const output = execSync(
|
exec(
|
||||||
`docker container inspect -f '{{.State.Running}}' ${name}`,
|
`docker container inspect -f '{{.State.Running}}' ${name}`,
|
||||||
{stdio: 'pipe'},
|
{stdio: 'pipe'},
|
||||||
).toString();
|
(error, stdout) => {
|
||||||
if ('true\n' === output) {
|
if (error) {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
if (1 !== e.status) {
|
if (1 !== e.status) {
|
||||||
throw e;
|
e(error);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
r(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
r('true\n' === stdout);
|
||||||
};
|
},
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
export default async (flecks, key, config) => {
|
export default async (flecks, key, config) => {
|
||||||
const {id} = flecks.get('@flecks/core');
|
const {id} = flecks.get('@flecks/core');
|
||||||
|
|
|
@ -12,12 +12,13 @@ const {
|
||||||
|
|
||||||
const debug = D('@flecks/fleck/fleck.neutrino.js');
|
const debug = D('@flecks/fleck/fleck.neutrino.js');
|
||||||
|
|
||||||
|
const config = require('../../../../core/src/bootstrap/fleck.neutrinorc');
|
||||||
|
|
||||||
|
module.exports = (async () => {
|
||||||
debug('bootstrapping flecks...');
|
debug('bootstrapping flecks...');
|
||||||
const flecks = Flecks.bootstrap();
|
const flecks = Flecks.bootstrap();
|
||||||
debug('bootstrapped');
|
debug('bootstrapped');
|
||||||
|
|
||||||
const config = require('../../../../core/src/bootstrap/fleck.neutrinorc');
|
|
||||||
|
|
||||||
const compiler = flecks.invokeFleck(
|
const compiler = flecks.invokeFleck(
|
||||||
'@flecks/fleck/compiler',
|
'@flecks/fleck/compiler',
|
||||||
flecks.get('@flecks/fleck.compiler'),
|
flecks.get('@flecks/fleck.compiler'),
|
||||||
|
@ -60,4 +61,5 @@ config.use.push((neutrino) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = config;
|
return config;
|
||||||
|
})();
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/* eslint-disable import/no-extraneous-dependencies */
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
const config = require('@flecks/fleck/server/build/fleck.neutrinorc');
|
|
||||||
const copy = require('@neutrinojs/copy');
|
const copy = require('@neutrinojs/copy');
|
||||||
/* eslint-enable import/no-extraneous-dependencies */
|
|
||||||
|
|
||||||
|
module.exports = (async () => {
|
||||||
|
// eslint-disable-next-line import/no-extraneous-dependencies, global-require
|
||||||
|
const config = await require('@flecks/fleck/server/build/fleck.neutrinorc');
|
||||||
config.use.push(({config}) => {
|
config.use.push(({config}) => {
|
||||||
config.entryPoints.delete('build/template');
|
config.entryPoints.delete('build/template');
|
||||||
});
|
});
|
||||||
|
|
||||||
config.use.push(
|
config.use.push(
|
||||||
copy({
|
copy({
|
||||||
copyUnmodified: true,
|
copyUnmodified: true,
|
||||||
|
@ -18,5 +18,5 @@ config.use.push(
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
return config;
|
||||||
module.exports = config;
|
})();
|
||||||
|
|
|
@ -14,10 +14,10 @@ const {
|
||||||
|
|
||||||
const debug = D('@flecks/http/http.neutrino.js');
|
const debug = D('@flecks/http/http.neutrino.js');
|
||||||
|
|
||||||
|
module.exports = (async () => {
|
||||||
debug('bootstrapping flecks...');
|
debug('bootstrapping flecks...');
|
||||||
const flecks = Flecks.bootstrap();
|
const flecks = Flecks.bootstrap();
|
||||||
debug('bootstrapped');
|
debug('bootstrapped');
|
||||||
|
|
||||||
// Neutrino configuration.
|
// Neutrino configuration.
|
||||||
const config = {
|
const config = {
|
||||||
options: {
|
options: {
|
||||||
|
@ -32,7 +32,7 @@ const config = {
|
||||||
FLECKS_CORE_BUILD_TARGET: 'client',
|
FLECKS_CORE_BUILD_TARGET: 'client',
|
||||||
}]);
|
}]);
|
||||||
},
|
},
|
||||||
targets(flecks),
|
await targets(flecks),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
// Compile code.
|
// Compile code.
|
||||||
|
@ -65,8 +65,8 @@ else {
|
||||||
// Configure dev server.
|
// Configure dev server.
|
||||||
config.use.push(devServer(flecks));
|
config.use.push(devServer(flecks));
|
||||||
// Build the client runtime.
|
// Build the client runtime.
|
||||||
config.use.push(runtime(flecks));
|
config.use.push(await runtime(flecks));
|
||||||
// Output configuration.
|
// Output configuration.
|
||||||
config.use.push(outputs());
|
config.use.push(outputs());
|
||||||
|
return config;
|
||||||
module.exports = config;
|
})();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const {realpathSync} = require('fs');
|
const {realpath} = require('fs/promises');
|
||||||
const {
|
const {
|
||||||
dirname,
|
dirname,
|
||||||
join,
|
join,
|
||||||
|
@ -10,10 +10,16 @@ const glob = require('glob');
|
||||||
|
|
||||||
const debug = D('@flecks/http/runtime');
|
const debug = D('@flecks/http/runtime');
|
||||||
|
|
||||||
module.exports = (flecks) => (neutrino) => {
|
module.exports = async (flecks) => {
|
||||||
debug('bootstrapping flecks...');
|
debug('bootstrapping flecks...');
|
||||||
const httpFlecks = Flecks.bootstrap({platforms: ['client'], without: ['server']});
|
const httpFlecks = Flecks.bootstrap({platforms: ['client'], without: ['server']});
|
||||||
debug('bootstrapped');
|
debug('bootstrapped');
|
||||||
|
const runtime = await realpath(R.resolve(join(flecks.resolve('@flecks/http'), 'runtime')));
|
||||||
|
const fullresolve = (fleck, path) => realpath(R.resolve(join(flecks.resolve(fleck), path)));
|
||||||
|
const entry = await fullresolve('@flecks/http', 'entry');
|
||||||
|
const importLoader = await fullresolve('@flecks/http', 'import-loader');
|
||||||
|
const tests = await realpath(R.resolve(join(flecks.resolve('@flecks/http'), 'tests')));
|
||||||
|
return (neutrino) => {
|
||||||
const {resolver} = httpFlecks;
|
const {resolver} = httpFlecks;
|
||||||
const paths = Object.entries(resolver);
|
const paths = Object.entries(resolver);
|
||||||
const source = [
|
const source = [
|
||||||
|
@ -36,7 +42,7 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
// HMR.
|
// HMR.
|
||||||
source.push('if (module.hot) {');
|
source.push('if (module.hot) {');
|
||||||
paths.forEach(([path]) => {
|
paths.forEach(([path]) => {
|
||||||
source.push(` module.hot.accept('${path}', () => {`);
|
source.push(` module.hot.accept('${path}', async () => {`);
|
||||||
source.push(` window.flecks.refresh('${path}', require('${path}'));`);
|
source.push(` window.flecks.refresh('${path}', require('${path}'));`);
|
||||||
source.push(` window.flecks.invoke('@flecks/core/hmr', '${path}');`);
|
source.push(` window.flecks.invoke('@flecks/core/hmr', '${path}');`);
|
||||||
source.push(' });');
|
source.push(' });');
|
||||||
|
@ -44,7 +50,6 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
source.push('}');
|
source.push('}');
|
||||||
source.push('');
|
source.push('');
|
||||||
// Create runtime.
|
// Create runtime.
|
||||||
const runtime = realpathSync(R.resolve(join(flecks.resolve('@flecks/http'), 'runtime')));
|
|
||||||
neutrino.config.module
|
neutrino.config.module
|
||||||
.rule(runtime)
|
.rule(runtime)
|
||||||
.test(runtime)
|
.test(runtime)
|
||||||
|
@ -57,13 +62,11 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
.set('@flecks/http/runtime$', runtime);
|
.set('@flecks/http/runtime$', runtime);
|
||||||
flecks.runtimeCompiler('http', neutrino);
|
flecks.runtimeCompiler('http', neutrino);
|
||||||
// Handle runtime import.
|
// Handle runtime import.
|
||||||
const fullresolve = (fleck, path) => realpathSync(R.resolve(join(flecks.resolve(fleck), path)));
|
|
||||||
const entry = fullresolve('@flecks/http', 'entry');
|
|
||||||
neutrino.config.module
|
neutrino.config.module
|
||||||
.rule(entry)
|
.rule(entry)
|
||||||
.test(entry)
|
.test(entry)
|
||||||
.use('entry/http')
|
.use('entry/http')
|
||||||
.loader(fullresolve('@flecks/http', 'import-loader'));
|
.loader(importLoader);
|
||||||
// Aliases.
|
// Aliases.
|
||||||
const aliases = flecks.aliases();
|
const aliases = flecks.aliases();
|
||||||
if (Object.keys(aliases).length > 0) {
|
if (Object.keys(aliases).length > 0) {
|
||||||
|
@ -101,7 +104,6 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
const testEntry = neutrino.config.entry('test').clear();
|
const testEntry = neutrino.config.entry('test').clear();
|
||||||
testPaths.forEach(([, path]) => testEntry.add(path));
|
testPaths.forEach(([, path]) => testEntry.add(path));
|
||||||
}
|
}
|
||||||
const tests = realpathSync(R.resolve(join(flecks.resolve('@flecks/http'), 'tests')));
|
|
||||||
neutrino.config.module
|
neutrino.config.module
|
||||||
.rule(tests)
|
.rule(tests)
|
||||||
.test(tests)
|
.test(tests)
|
||||||
|
@ -123,3 +125,4 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
).join(''),
|
).join(''),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
const {dirname, join} = require('path');
|
const {dirname, join} = require('path');
|
||||||
const {realpathSync} = require('fs');
|
const {realpath} = require('fs/promises');
|
||||||
|
|
||||||
const {require: R} = require('@flecks/core/server');
|
const {require: R} = require('@flecks/core/server');
|
||||||
|
|
||||||
|
@ -8,14 +8,16 @@ const {
|
||||||
FLECKS_CORE_ROOT = process.cwd(),
|
FLECKS_CORE_ROOT = process.cwd(),
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
module.exports = (flecks) => (neutrino) => {
|
module.exports = async (flecks) => {
|
||||||
|
const root = await realpath(dirname(R.resolve(join(flecks.resolve('@flecks/http'), 'entry.js'))));
|
||||||
|
return (neutrino) => {
|
||||||
const {options} = neutrino;
|
const {options} = neutrino;
|
||||||
const {output: originalOutput} = options;
|
const {output: originalOutput} = options;
|
||||||
neutrino.config.resolve.modules.merge([
|
neutrino.config.resolve.modules.merge([
|
||||||
join(FLECKS_CORE_ROOT, 'node_modules'),
|
join(FLECKS_CORE_ROOT, 'node_modules'),
|
||||||
'node_modules',
|
'node_modules',
|
||||||
]);
|
]);
|
||||||
options.root = realpathSync(dirname(R.resolve(join(flecks.resolve('@flecks/http'), 'entry.js'))));
|
options.root = root;
|
||||||
options.source = '.';
|
options.source = '.';
|
||||||
options.mains.index = 'entry';
|
options.mains.index = 'entry';
|
||||||
options.mains.tests = {
|
options.mains.tests = {
|
||||||
|
@ -24,3 +26,4 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
};
|
};
|
||||||
options.output = join(originalOutput, flecks.get('@flecks/http/server.output'));
|
options.output = join(originalOutput, flecks.get('@flecks/http/server.output'));
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
const {realpathSync} = require('fs');
|
const {realpath} = require('fs/promises');
|
||||||
const {join} = require('path');
|
const {join} = require('path');
|
||||||
|
|
||||||
const {require: R} = require('@flecks/core/server');
|
const {require: R} = require('@flecks/core/server');
|
||||||
|
|
||||||
module.exports = (flecks) => (neutrino) => {
|
module.exports = async (flecks) => {
|
||||||
|
const runtime = await realpath(R.resolve(join(flecks.resolve('@flecks/server'), 'runtime')));
|
||||||
|
return (neutrino) => {
|
||||||
const {config, resolver} = flecks;
|
const {config, resolver} = flecks;
|
||||||
// Inject flecks configuration.
|
// Inject flecks configuration.
|
||||||
const paths = Object.keys(resolver);
|
const paths = Object.keys(resolver);
|
||||||
|
@ -40,7 +42,7 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
source.push(' });');
|
source.push(' });');
|
||||||
// Hooks for each fleck.
|
// Hooks for each fleck.
|
||||||
paths.forEach((path) => {
|
paths.forEach((path) => {
|
||||||
source.push(` module.hot.accept('${path}', () => {`);
|
source.push(` module.hot.accept('${path}', async () => {`);
|
||||||
source.push(` global.flecks.refresh('${path}', require('${path}'));`);
|
source.push(` global.flecks.refresh('${path}', require('${path}'));`);
|
||||||
source.push(` global.flecks.invoke('@flecks/core/hmr', '${path}');`);
|
source.push(` global.flecks.invoke('@flecks/core/hmr', '${path}');`);
|
||||||
source.push(' });');
|
source.push(' });');
|
||||||
|
@ -48,7 +50,6 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
source.push('}');
|
source.push('}');
|
||||||
// Create runtime.
|
// Create runtime.
|
||||||
const entries = neutrino.config.entry('index');
|
const entries = neutrino.config.entry('index');
|
||||||
const runtime = realpathSync(R.resolve(join(flecks.resolve('@flecks/server'), 'runtime')));
|
|
||||||
neutrino.config.module
|
neutrino.config.module
|
||||||
.rule(runtime)
|
.rule(runtime)
|
||||||
.test(runtime)
|
.test(runtime)
|
||||||
|
@ -77,3 +78,4 @@ module.exports = (flecks) => (neutrino) => {
|
||||||
const nodeExternals = R('webpack-node-externals');
|
const nodeExternals = R('webpack-node-externals');
|
||||||
neutrino.config.externals(nodeExternals({allowlist}));
|
neutrino.config.externals(nodeExternals({allowlist}));
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
|
@ -14,6 +14,8 @@ const {
|
||||||
|
|
||||||
const debug = D('@flecks/server/server.neutrino.js');
|
const debug = D('@flecks/server/server.neutrino.js');
|
||||||
|
|
||||||
|
module.exports = (async () => {
|
||||||
|
|
||||||
debug('bootstrapping flecks...');
|
debug('bootstrapping flecks...');
|
||||||
const flecks = Flecks.bootstrap();
|
const flecks = Flecks.bootstrap();
|
||||||
debug('bootstrapped');
|
debug('bootstrapped');
|
||||||
|
@ -121,7 +123,7 @@ if (Object.keys(aliases).length > 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the server runtime.
|
// Build the server runtime.
|
||||||
config.use.push(runtime(flecks));
|
config.use.push(await runtime(flecks));
|
||||||
|
|
||||||
// Give the resolver a helping hand.
|
// Give the resolver a helping hand.
|
||||||
config.use.push((neutrino) => {
|
config.use.push((neutrino) => {
|
||||||
|
@ -131,4 +133,5 @@ config.use.push((neutrino) => {
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = config;
|
return config;
|
||||||
|
})();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user