File tree Expand file tree Collapse file tree 12 files changed +1228
-1182
lines changed Expand file tree Collapse file tree 12 files changed +1228
-1182
lines changed Original file line number Diff line number Diff line change @@ -486,7 +486,7 @@ export default Index;
486
486
487
487
If the current project only needs to load MF in CSR , you can set ` ssr: false ` to help with progressive migration .
488
488
489
- ` ` ` title='modern.config.ts'
489
+ ` ` ` ts title='modern.config.ts'
490
490
import { appTools, defineConfig } from '@modern-js/app-tools';
491
491
import { moduleFederationPlugin } from '@module-federation/modern-js';
492
492
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build
169
169
170
170
` .env` can be set as well, but can be unreliable in setting ` NEXT_PRIVATE_LOCAL_WEBPACK` in time.
171
171
172
- ` ` ` .env title=" .env"
172
+ ` ` ` ini title=" .env"
173
173
NEXT_PRIVATE_LOCAL_WEBPACK=true
174
174
` ` `
175
175
Original file line number Diff line number Diff line change @@ -488,7 +488,7 @@ export default Index;
488
488
489
489
如果当前项目仅需要在 CSR 加载 MF ,那么可以设置 ` ssr: false ` 来帮助渐进式迁移。
490
490
491
- ` ` ` title='modern.config.ts'
491
+ ` ` ` ts title='modern.config.ts'
492
492
import { appTools, defineConfig } from '@modern-js/app-tools';
493
493
import { moduleFederationPlugin } from '@module-federation/modern-js';
494
494
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build
164
164
165
165
` .env ` 也可以设置,但及时设置 ` NEXT_PRIVATE_LOCAL_WEBPACK ` 可能不可靠。
166
166
167
- ``` .env title=".env"
167
+ ``` ini title=".env"
168
168
NEXT_PRIVATE_LOCAL_WEBPACK =true
169
169
```
170
170
Original file line number Diff line number Diff line change 9
9
},
10
10
"dependencies" : {
11
11
"framer-motion" : " ^10.0.0" ,
12
- "rspress" : " 1.34.1 " ,
12
+ "rspress" : " 2.0.0-beta.13 " ,
13
13
"tailwindcss" : " ^3.2.7" ,
14
14
"video-react" : " ^0.16.0" ,
15
15
"xgplayer" : " ^3.0.16" ,
16
16
"rspress-plugin-annotation-words" : " 0.0.1" ,
17
- "@module-federation/error-codes" : " workspace:*"
17
+ "@rsbuild/plugin-sass" : " ^1.3.2" ,
18
+ "@module-federation/error-codes" : " workspace:*" ,
19
+ "@rspress/plugin-llms" : " 2.0.0-beta.13"
18
20
},
19
21
"devDependencies" : {
20
22
"@types/node" : " ^20"
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import * as path from 'path';
2
2
import { defineConfig } from 'rspress/config' ;
3
3
import { moduleFederationPluginOverview } from './src/moduleFederationPluginOverview' ;
4
4
import { pluginAnnotationWords } from 'rspress-plugin-annotation-words' ;
5
+ import { pluginSass } from '@rsbuild/plugin-sass' ;
6
+ import { pluginLlms } from '@rspress/plugin-llms' ;
5
7
6
8
const getNavbar = ( lang : string ) => {
7
9
const cn = lang === 'zh' ;
@@ -81,15 +83,16 @@ export default defineConfig({
81
83
pluginAnnotationWords ( {
82
84
wordsMapPath : 'words-map.json' ,
83
85
} ) ,
86
+ pluginLlms ( ) ,
84
87
] ,
85
88
builderConfig : {
86
- plugins : [ moduleFederationPluginOverview ] ,
89
+ plugins : [ moduleFederationPluginOverview , pluginSass ( ) ] ,
87
90
tools : {
88
91
postcss : ( config , { addPlugins } ) => {
89
92
addPlugins ( [ require ( 'tailwindcss/nesting' ) , require ( 'tailwindcss' ) ] ) ;
90
93
} ,
91
94
} ,
92
- source : {
95
+ resolve : {
93
96
alias : {
94
97
'@site' : path . resolve ( __dirname ) ,
95
98
'@components' : path . join ( __dirname , 'src/components' ) ,
Original file line number Diff line number Diff line change 1
- import { useEffect , useState } from 'react' ;
1
+ import { useEffect , useLayoutEffect , useState } from 'react' ;
2
2
import { useI18n } from '../../theme/i18n' ;
3
3
import Player from 'xgplayer' ;
4
4
import 'xgplayer/dist/index.min.css' ;
@@ -31,13 +31,17 @@ export default function AnnouncementVideo(props: {
31
31
} ;
32
32
}
33
33
34
- const [ divWidth , setDivWidth ] = useState ( window . innerWidth ) ;
34
+ const [ divWidth , setDivWidth ] = useState ( 0 ) ;
35
35
36
36
// 更新宽度的函数
37
37
const updateWidth = ( ) => {
38
38
setDivWidth ( window . innerWidth ) ;
39
39
} ;
40
40
41
+ useLayoutEffect ( ( ) => {
42
+ updateWidth ( ) ;
43
+ } , [ ] ) ;
44
+
41
45
useEffect ( ( ) => {
42
46
window . addEventListener ( 'resize' , updateWidth ) ;
43
47
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export function HomeFeature({ features }: { features: Feature[] }) {
52
52
}
53
53
} }
54
54
>
55
- < div className = "flex-center" >
55
+ < div className = "flex justify-center items -center" >
56
56
< div className = "w-12 h-12 text-3xl text-center" > { icon } </ div >
57
57
</ div >
58
58
< h2 className = "font-bold text-center" > { title } </ h2 >
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export function HomeFooter() {
87
87
</ div >
88
88
) ) }
89
89
</ div >
90
- < div className = "flex flex -center" >
90
+ < div className = "flex justify-center items -center" >
91
91
< h2 className = "font-normal text-sm text-gray-600 dark:text-light-600 py-4" >
92
92
© { new Date ( ) . getFullYear ( ) } Module Federation core team. All Rights
93
93
Reserved.
Original file line number Diff line number Diff line change @@ -50,17 +50,18 @@ export function HomeHero({ hero }: { hero: Hero }) {
50
50
< Button
51
51
className = "pl-2 pr-2"
52
52
type = "a"
53
- text = { action . text }
54
53
href = { normalizeHrefInRuntime ( action . link ) }
55
54
theme = { action . theme }
56
- />
55
+ >
56
+ { action . text }
57
+ </ Button >
57
58
</ div >
58
59
) ) }
59
60
</ div >
60
61
</ div >
61
62
62
63
{ hasImage ? (
63
- < div className = "modern-doc-home-hero-image m-auto flex -center md:none lg:flex order-1 md:order-2" >
64
+ < div className = "modern-doc-home-hero-image m-auto justify-center items -center md:none lg:flex order-1 md:order-2" >
64
65
< div className = { styles . imgMask } > </ div >
65
66
< img src = "/svg.svg" alt = { hero . image ?. alt } />
66
67
</ div >
Original file line number Diff line number Diff line change 1
- import Theme from 'rspress/theme' ;
2
1
import { HomeLayout } from './pages' ;
3
2
import './index.css' ;
4
3
5
- // eslint-disable-next-line import/export
4
+ export { HomeLayout } ;
6
5
export * from 'rspress/theme' ;
7
-
8
- export default {
9
- ...Theme ,
10
- HomeLayout,
11
- } ;
You can’t perform that action at this time.
0 commit comments