对于还没有使用
npm run eject
弹出自定义配置的娃,自行网补吧
出于某些原因,于是将 react 的 src 目录 和 一些文件修改至 pages 里面
.
├── config
├── public
├── scripts
├── src
├── tsconfig.json
└── pakage.json
改成如下:
.
└── pages
│ ├── config
│ ├── public
│ ├── scripts
│ ├── src
│ └── tsconfig.json
└── pakage.json
需要修改的配置文件
-
package.json
:{ "scripts": { "start": "node pages/scripts/start.js", "build": "node pages/scripts/build.js", "test": "node pages/scripts/test.js" } }
-
pages/config/paths.js
// ... module.exports = { // ... appPath: resolveApp('pages'), appBuild: resolveApp('pages/build'), appPublic: resolveApp('pages/public'), appHtml: resolveApp('pages/public/index.html'), appIndexJs: resolveModule(resolveApp, 'pages/src/index'), appSrc: resolveApp('pages/src'), appTsConfig: resolveApp('pages/tsconfig.json'), appJsConfig: resolveApp('pages/jsconfig.json'), testsSetup: resolveModule(resolveApp, 'pages/src/setupTests'), proxySetup: resolveApp('pages/src/setupProxy.js'), publicUrl: getPublicUrl(resolveApp('package.json')), servedPath: getServedPath(resolveApp('package.json')) }
要改的有点多,未完整测试,能跑起来,欢迎踩坑
image.png---- Vinci, Wed May 08 2019, Sunny
网友评论