Skip to content

Commit 06c30b8

Browse files
committed
feat(module-loader): 服务端渲染
affects: @vue-async/module-loader-typing, @vue-async/module-loader
1 parent 4860b8c commit 06c30b8

31 files changed

+287
-5552
lines changed

packages/module-loader-typing/module.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ export type DynamicComponent =
77
| ({ component: VueComponent | AsyncComponent; name?: string } & Record<string, any>);
88

99
export interface ModuleContext {
10-
$componentLoader: (componentName: string, path: string) => Promise<VueComponent>;
10+
$componentLoader: (componentName: string, path: string, styles?: string | string[]) => Promise<VueComponent>;
1111
$dynamicComponent?: {
12+
namespaces: string;
1213
add: (component: DynamicComponent, position?: string) => void;
1314
remove: (name: string, position?: string) => void;
1415
};

packages/module-loader/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,19 @@ Type: `Object`
155155

156156
注:当主组件引用`vue-router`包后,将会自动注入方法解决404问题,需要在主程序中添加一条配置 `name``404` `page-not-found` `not-found``path``*` 的路由后生效
157157

158+
<br>
159+
<br>
160+
<br>
161+
162+
## <font color="red">问题</font>
163+
1、webpack 打包 Can't resolve "module"
164+
``` json
165+
{
166+
node:{
167+
module:'empty'
168+
}
169+
}
170+
```
158171

159172

160173

0 commit comments

Comments
 (0)