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

Commit c1c0d28

Browse files
committed
chore: renderLayout 路径改为可配
1 parent a420eab commit c1c0d28

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/yk-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yk-cli",
3-
"version": "2.8.6",
3+
"version": "2.8.7",
44
"description": "ykcli for ssr",
55
"main": "./lib/index.js",
66
"module": "./es/index.js",

packages/yk-cli/src/renderLayout.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ import { renderToNodeStream } from 'react-dom/server'
77
import nodeExternals from 'webpack-node-externals'
88
import { webpackWithPromise } from './util'
99

10+
const cwd = process.env.BASE_DIR || process.cwd()
1011
let config: any
1112
try {
12-
config = require('../../../config/config.ssr')
13+
config = require(cwd + '/config/config.ssr')
1314
} catch (error) {
1415
// 兼容以前的版本,没有config.ssr取config.default
15-
config = require('../../../config/config.default')
16+
config = require(cwd + '/config/config.default')
1617
}
1718

18-
const paths = require('../../../build/paths')
19-
const serverConfig = require('../../../build/webpack.config.server')
19+
const paths = require(cwd + '/build/paths')
20+
const serverConfig = require(cwd + '/build/webpack.config.server')
2021
const isDev = process.env.NODE_ENV === 'development'
2122

2223
serverConfig.entry = {

0 commit comments

Comments
 (0)