Skip to content

Commit f8b90e8

Browse files
authored
chore: remove node-bundle-require (#8001)
1 parent 7e3636b commit f8b90e8

File tree

31 files changed

+0
-2202
lines changed

31 files changed

+0
-2202
lines changed

packages/solutions/app-tools/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
"@babel/parser": "^7.28.5",
112112
"@babel/traverse": "^7.28.5",
113113
"@babel/types": "^7.28.5",
114-
"@modern-js/node-bundle-require": "workspace:*",
115114
"@modern-js/plugin-data-loader": "workspace:*",
116115
"@modern-js/i18n-utils": "workspace:*",
117116
"@modern-js/plugin": "workspace:*",

packages/solutions/app-tools/src/commands/dev.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from '@modern-js/utils';
1616
import type { ConfigChain } from '@rsbuild/core';
1717
import type { AppNormalizedConfig, AppTools } from '../types';
18-
import { buildServerConfig } from '../utils/config';
1918
import { setServer } from '../utils/createServer';
2019
import { loadServerPlugins } from '../utils/loadPlugins';
2120
import { printInstructions } from '../utils/printInstructions';
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
export type { ServerPlugin } from '@modern-js/server-core';
2-
3-
export { defineServerConfig as defineConfig } from '../utils/config';

packages/solutions/app-tools/src/utils/config.ts

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as path from 'path';
2-
import { bundle } from '@modern-js/node-bundle-require';
32
import type { ServerConfig } from '@modern-js/server-core';
43
import {
54
fs,
@@ -11,68 +10,6 @@ import {
1110
import { stringify } from 'flatted';
1211
import type { AppNormalizedConfig } from '../types';
1312

14-
export const defineServerConfig = (config: ServerConfig): ServerConfig =>
15-
config;
16-
17-
export const buildServerConfig = async ({
18-
appDirectory,
19-
distDirectory,
20-
configFile,
21-
options,
22-
watch,
23-
}: {
24-
appDirectory: string;
25-
distDirectory: string;
26-
configFile: string;
27-
options?: Parameters<typeof bundle>[1];
28-
watch?: boolean;
29-
}) => {
30-
const configFilePath = await getServerConfig(appDirectory, configFile);
31-
32-
const getOutputFile = async (filepath: string) =>
33-
path.resolve(
34-
distDirectory,
35-
`${filepath.replace(
36-
new RegExp(CONFIG_FILE_EXTENSIONS.join('|')),
37-
'',
38-
)}.cjs`,
39-
);
40-
41-
if (configFilePath) {
42-
const configHelperFilePath = path.normalize(
43-
path.join(distDirectory, './config-helper.js'),
44-
);
45-
const helperCode = `
46-
export const defineConfig = (config) => config;
47-
`;
48-
49-
await fs.ensureDir(distDirectory);
50-
await fs.writeFile(configHelperFilePath, helperCode);
51-
await bundle(configFilePath, {
52-
...options,
53-
watch,
54-
getOutputFile,
55-
esbuildPlugins: [
56-
{
57-
name: 'native-build-config',
58-
setup(ctx) {
59-
ctx.onResolve(
60-
{
61-
filter: /app-tools\/server/,
62-
},
63-
() => {
64-
return {
65-
path: configHelperFilePath,
66-
};
67-
},
68-
);
69-
},
70-
},
71-
],
72-
});
73-
}
74-
};
75-
7613
export const emitResolvedConfig = async (
7714
appDirectory: string,
7815
resolvedConfig: AppNormalizedConfig,

packages/toolkit/node-bundle-require/.npmignore

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)