Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit 758e9d6

Browse files
committed
fix: 修复example paths.js路径错误
1 parent 4777e85 commit 758e9d6

File tree

9 files changed

+25
-29
lines changed

9 files changed

+25
-29
lines changed

example/ssr-with-antd/web/entry.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const clientRender = async () => {
1515
const ActiveComponent = Component()
1616
const Layout = ActiveComponent.Layout || defaultLayout
1717
const WrappedComponent = getWrappedComponent(ActiveComponent)
18-
return <Route exact={exact} key={path} path={path} render={() => {
19-
return <Layout><WrappedComponent /></Layout>
20-
}} />
18+
return <Route exact={exact} key={path} path={path} render={() => <Layout><WrappedComponent /></Layout>} />
2119
})
2220
}
2321
</BrowserRouter>

example/ssr-with-dva/web/entry.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ const clientRender = () => {
3333
const ActiveComponent = Component()
3434
const Layout = ActiveComponent.Layout || defaultLayout
3535
const WrappedComponent = getWrappedComponent(ActiveComponent)
36-
return <Route exact={exact} key={path} path={path} render={() => {
37-
return <Layout><WrappedComponent store={store} /></Layout>
38-
}} />
36+
return <Route exact={exact} key={path} path={path} render={() => <Layout><WrappedComponent store={store} /></Layout>} />
3937
})
4038
}
4139
</Switch>

example/ssr-with-js/build/paths.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const fs = require('fs')
55

66
// Make sure any symlinks in the project folder are resolved:
77
// https://github.com/facebook/create-react-app/issues/637
8-
const appDirectory = fs.realpathSync(__dirname)
8+
const appDirectory = fs.realpathSync(process.cwd())
99
const resolveApp = relativePath => path.resolve(appDirectory, relativePath)
1010

1111
const envPublicUrl = process.env.PUBLIC_URL
@@ -29,12 +29,15 @@ const moduleFileExtensions = [
2929

3030
// config after eject: we're in ./config/
3131
module.exports = {
32-
appPath: resolveApp('../'),
33-
appBuild: resolveApp('../dist'),
34-
appSrc: resolveApp('../web'),
35-
entry: resolveApp('../web/entry'),
32+
dotenv: resolveApp('.env'),
33+
appPath: resolveApp('.'),
34+
appBuild: resolveApp('dist'),
35+
appPublic: resolveApp('app/public'),
36+
appPackageJson: resolveApp('package.json'),
37+
appSrc: resolveApp('web'),
38+
entry: resolveApp('web/entry'),
3639
appNodeModules: resolveApp('node_modules'),
37-
publicUrl: getPublicUrl(resolveApp('../package.json')),
40+
publicUrl: getPublicUrl(resolveApp('package.json')),
3841
resolveApp: resolveApp
3942
}
4043

example/ssr-with-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ssr-with-js",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
44
"dependencies": {
55
"egg": "^2.21.0",
66
"egg-scripts": "^2.11.0",

example/ssr-with-js/web/entry.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const clientRender = async () => {
1515
const ActiveComponent = Component()
1616
const Layout = ActiveComponent.Layout || defaultLayout
1717
const WrappedComponent = getWrappedComponent(ActiveComponent)
18-
return <Route exact={exact} key={path} path={path} render={() => {
19-
return <Layout><WrappedComponent /></Layout>
20-
}} />
18+
return <Route exact={exact} key={path} path={path} render={() => <Layout><WrappedComponent /></Layout>} />
2119
})
2220
}
2321
</BrowserRouter>

example/ssr-with-loadable/web/entry.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const clientRender = async () => {
1515
const activeComponent = Component()
1616
const WrappedComponent = getWrappedComponent(activeComponent)
1717
const Layout = WrappedComponent.Layout || defaultLayout
18-
return <Route exact={exact} key={path} path={path} render={() => {
19-
return <Layout><WrappedComponent /></Layout>
20-
}} />
18+
return <Route exact={exact} key={path} path={path} render={() => <Layout><WrappedComponent /></Layout>} />
2119
})
2220
}
2321
</BrowserRouter>

example/ssr-with-mobx/web/entry.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ const clientRender = async () => {
2222
const ActiveComponent = Component()
2323
const Layout = ActiveComponent.Layout || defaultLayout
2424
const WrappedComponent = getWrappedComponent(ActiveComponent)
25-
return <Route exact={exact} key={path} path={path} render={() => {
26-
return <Layout><WrappedComponent store={store} /></Layout>
27-
}} />
25+
return <Route exact={exact} key={path} path={path} render={() => <Layout><WrappedComponent store={store} /></Layout>} />
2826
})
2927
}
3028
</BrowserRouter>

example/ssr-with-ts/build/paths.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const fs = require('fs')
55

66
// Make sure any symlinks in the project folder are resolved:
77
// https://github.com/facebook/create-react-app/issues/637
8-
const appDirectory = fs.realpathSync(__dirname)
8+
const appDirectory = fs.realpathSync(process.cwd())
99
const resolveApp = relativePath => path.resolve(appDirectory, relativePath)
1010

1111
const envPublicUrl = process.env.PUBLIC_URL
@@ -29,12 +29,15 @@ const moduleFileExtensions = [
2929

3030
// config after eject: we're in ./config/
3131
module.exports = {
32-
appPath: resolveApp('../'),
33-
appBuild: resolveApp('../output'),
34-
appSrc: resolveApp('../web'),
35-
entry: resolveApp('../web/entry'),
32+
dotenv: resolveApp('.env'),
33+
appPath: resolveApp('.'),
34+
appBuild: resolveApp('output'),
35+
appPublic: resolveApp('app/public'),
36+
appPackageJson: resolveApp('package.json'),
37+
appSrc: resolveApp('web'),
38+
entry: resolveApp('web/entry'),
3639
appNodeModules: resolveApp('node_modules'),
37-
publicUrl: getPublicUrl(resolveApp('../package.json')),
40+
publicUrl: getPublicUrl(resolveApp('package.json')),
3841
resolveApp: resolveApp
3942
}
4043

example/ssr-with-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ssr-with-ts",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"description": "ykfe",
55
"dependencies": {
66
"egg-scripts": "^2.10.0",

0 commit comments

Comments
 (0)