Skip to content

Commit f9d2cd2

Browse files
authored
fix: support useHonoContext in the loader (#7236)
1 parent 46882db commit f9d2cd2

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

.changeset/weak-bobcats-see.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@modern-js/app-tools': patch
3+
---
4+
5+
fix: support useHonoContext in the loader
6+
fix: 支持在 loader 中使用 useHonoContext

packages/solutions/app-tools/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import analyzePlugin from './plugins/analyze';
2828
import deployPlugin from './plugins/deploy';
2929
import initializePlugin from './plugins/initialize';
3030
import serverBuildPlugin from './plugins/serverBuild';
31+
import serverRuntimePlugin from './plugins/serverRuntime';
3132
import type { AppTools, AppToolsOptions, CliPluginFuture } from './types';
3233
import type {
3334
AddRuntimeExportsFn,
@@ -56,6 +57,7 @@ export const appTools = (
5657
): CliPluginFuture<AppTools<'shared'>> => ({
5758
name: '@modern-js/app-tools',
5859
usePlugins: [
60+
serverRuntimePlugin(),
5961
compatPlugin(),
6062
initializePlugin({
6163
bundler:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { AppTools, CliPluginFuture } from '../types';
2+
3+
export default (): CliPluginFuture<AppTools<'shared'>> => ({
4+
name: '@modern-js/plugin-server-runtime',
5+
setup(api) {
6+
api.config(() => ({
7+
output: {
8+
externals: [
9+
{
10+
'@modern-js/server-runtime': '@modern-js/server-runtime',
11+
},
12+
],
13+
},
14+
}));
15+
},
16+
});

0 commit comments

Comments
 (0)