Skip to content

Commit 10ab803

Browse files
author
Daniel Del Core
committed
Drops babel register
1 parent 08ff85c commit 10ab803

File tree

3 files changed

+2
-44
lines changed

3 files changed

+2
-44
lines changed

packages/cli/src/utils/module-loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const ModuleLoader = (config: {
6565
return {
6666
install,
6767
getInfo,
68-
require: (packageName: string) => await import(packageName),
68+
require: async (packageName: string) => await import(packageName),
6969
};
7070
};
7171

packages/fetcher/package.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,10 @@
88
"license": "MIT",
99
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/packages/fetcher",
1010
"dependencies": {
11-
"@babel/core": "^7.23.0",
12-
"@babel/parser": "^7.23.0",
13-
"@babel/plugin-proposal-class-properties": "^7.13.0",
14-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8",
15-
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
16-
"@babel/plugin-transform-modules-commonjs": "^7.13.8",
17-
"@babel/preset-typescript": "^7.23.0",
18-
"@babel/register": "^7.23.0",
1911
"@hypermod/types": "*",
2012
"chalk": "^4.1.0",
2113
"fs-extra": "^9.1.0",
22-
"globby": "^11.1.0",
23-
"live-plugin-manager": "^0.18.1"
14+
"globby": "^11.1.0"
2415
},
2516
"engines": {
2617
"node": ">=20.17"

packages/fetcher/src/index.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,6 @@ export interface ModuleLoader {
1515
require: (packageName: string) => any;
1616
}
1717

18-
// This configuration allows us to require TypeScript config files directly
19-
const { DEFAULT_EXTENSIONS } = require('@babel/core');
20-
const presets = [];
21-
22-
let presetEnv;
23-
try {
24-
presetEnv = require('@babel/preset-env');
25-
presets.push([presetEnv.default, { targets: { node: true } }]);
26-
} catch (_) {}
27-
28-
require('@babel/register')({
29-
configFile: false,
30-
babelrc: false,
31-
presets: [...presets, require('@babel/preset-typescript').default],
32-
plugins: [
33-
require('@babel/plugin-transform-class-properties').default,
34-
require('@babel/plugin-transform-nullish-coalescing-operator').default,
35-
require('@babel/plugin-transform-optional-chaining').default,
36-
require('@babel/plugin-transform-modules-commonjs').default,
37-
require('@babel/plugin-transform-private-methods').default,
38-
],
39-
extensions: [...DEFAULT_EXTENSIONS, '.ts', '.tsx'],
40-
// By default, babel register only compiles things inside the current working directory.
41-
// https://github.com/babel/babel/blob/2a4f16236656178e84b05b8915aab9261c55782c/packages/babel-register/src/node.js#L140-L157
42-
ignore: [
43-
// Ignore parser related files
44-
/@babel\/parser/,
45-
/\/flow-parser\//,
46-
/\/recast\//,
47-
/\/ast-types\//,
48-
],
49-
});
50-
5118
export interface ConfigMeta {
5219
filePath: string;
5320
config: Config;

0 commit comments

Comments
 (0)