-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.cjs
64 lines (57 loc) · 2.54 KB
/
babel.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// @ts-check
'use strict';
const { deepMergeConfig } = require('@-xun/symbiote/assets');
const {
assertEnvironment,
moduleExport
} = require('@-xun/symbiote/assets/babel.config.cjs');
// ? This needs to be this way only for this project since rejoinder and
// ? symbiote have a co-dependent relationship
const { createDebugLogger } = require('rejoinder~dev');
const debug = createDebugLogger({ namespace: 'symbiote:config:babel' });
module.exports = deepMergeConfig(
moduleExport({
derivedAliases: getBabelAliases(),
...assertEnvironment({ projectRoot: __dirname })
}),
{
// Any custom configs here will be deep merged with moduleExport's result
}
);
debug('exported config: %O', module.exports);
function getBabelAliases() {
// ! These aliases are auto-generated by symbiote. Instead of modifying them
// ! directly, consider regenerating aliases across the entire project with:
// ! `npx symbiote project renovate --regenerate-assets --assets-preset ...`
return {
'^multiverse\\+cli:(.+)$': './packages/cli/src/$1',
'^multiverse\\+debug:(.+)$': './packages/debug/src/$1',
'^multiverse\\+github:(.+)$': './packages/github/src/$1',
'^multiverse\\+listr2:(.+)$': './packages/listr2/src/$1',
'^multiverse\\+cli$': './packages/cli/src/index.js',
'^multiverse\\+debug$': './packages/debug/src/index.js',
'^multiverse\\+github$': './packages/github/src/index.js',
'^multiverse\\+listr2$': './packages/listr2/src/index.js',
'^rootverse\\+cli:(.+)$': './packages/cli/$1',
'^rootverse\\+debug:(.+)$': './packages/debug/$1',
'^rootverse\\+github:(.+)$': './packages/github/$1',
'^rootverse\\+listr2:(.+)$': './packages/listr2/$1',
'^rootverse:(.+)$': './$1',
'^universe\\+cli:(.+)$': './packages/cli/src/$1',
'^universe\\+debug:(.+)$': './packages/debug/src/$1',
'^universe\\+github:(.+)$': './packages/github/src/$1',
'^universe\\+listr2:(.+)$': './packages/listr2/src/$1',
'^universe\\+cli$': './packages/cli/src/index.js',
'^universe\\+debug$': './packages/debug/src/index.js',
'^universe\\+github$': './packages/github/src/index.js',
'^universe\\+listr2$': './packages/listr2/src/index.js',
'^universe:(.+)$': './src/$1',
'^universe$': './src/index.js',
'^testverse\\+cli:(.+)$': './packages/cli/test/$1',
'^testverse\\+debug:(.+)$': './packages/debug/test/$1',
'^testverse\\+github:(.+)$': './packages/github/test/$1',
'^testverse\\+listr2:(.+)$': './packages/listr2/test/$1',
'^testverse:(.+)$': './test/$1',
'^typeverse:(.+)$': './types/$1'
};
}