1.create-react-app
2.自定義配置項
npm run eject
導出scripts後npm install
重新下載依賴
3.自定義打包路徑
// path.js
// 37行pathname改爲相對路徑
function getServedPath(appPackageJson) {
const publicUrl = getPublicUrl(appPackageJson);
const servedUrl =
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : './');
return ensureSlash(servedUrl, true);
}
// 73行appBuild改爲如下自定義路徑
appBuild: path.resolve(__dirname, '../../dist/panorama'),
最終打包路徑爲 項目外部dist下,包名爲panorama