fix: babel config merging

This commit is contained in:
cha0s 2022-03-18 16:34:03 -05:00
parent 8a602a477d
commit 958f3b80a1
2 changed files with 5 additions and 5 deletions

View File

@ -188,7 +188,7 @@ export default class ServerFlecks extends Flecks {
if (needCompilation.length > 0) {
const register = R('@babel/register');
// Augment the compiler with babel config from flecksrc.
const rcBabelConfig = babelmerge(...this.babel(rcs).map(([, babel]) => babel));
const rcBabelConfig = babelmerge.all(this.babel(rcs).map(([, babel]) => babel));
debug('.flecksrc: babel: %O', rcBabelConfig);
// Key flecks needing compilation by their roots, so we can compile all common roots with a
// single invocation of `@babel/register`.
@ -566,7 +566,7 @@ export default class ServerFlecks extends Flecks {
const babel = {
configFile,
// Augment the compiler with babel config from flecksrc.
...babelmerge(...rcBabel.map(([, babel]) => babel)),
...babelmerge.all(rcBabel.map(([, babel]) => babel)),
};
compileLoader({
ignore: [sourceroot],

View File

@ -16,12 +16,12 @@ const config = require('../../../../core/src/bootstrap/fleck.neutrinorc');
module.exports = async (flecks) => {
// Compile.
const rcBabel = flecks.babel();
debug('.flecksrc: babel: %O', rcBabel);
debug('.flecksrc: babel: %j', rcBabel);
config.use.push(fleck({
babel: babelmerge(
babel: babelmerge.all([
{configFile: flecks.buildConfig('babel.config.js')},
...rcBabel.map(([, babel]) => babel),
),
]),
}));
config.use.push(({config}) => {
config.stats(flecks.get('@flecks/fleck/server.stats'));