-
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathbabel.config.cjs
More file actions
46 lines (39 loc) · 1.32 KB
/
babel.config.cjs
File metadata and controls
46 lines (39 loc) · 1.32 KB
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
// @ts-check
'use strict';
const { deepMergeConfig } = require('@-xun/symbiote/assets');
const {
assertEnvironment,
moduleExport
} = require('@-xun/symbiote/assets/babel.config.cjs');
const { createDebugLogger } = require('rejoinder');
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
// You may wish to enable explicit exports references for improved testing
// DX, but be aware that it is currently a wee buggy as of 5/2025 (fix it!)
//
// env: {
// test: {
// plugins: ['babel-plugin-explicit-exports-references']
// }
// }
}
);
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 {
'^universe:(.+)$': './src/$1',
'^universe$': './src/index.js',
'^testverse:(.+)$': './test/$1',
'^typeverse:(.+)$': './types/$1',
'^rootverse:(.+)$': './$1'
};
}