sorrycc / roadhog

🐷 Cli tool for creating react apps, configurable version of create-react-app.
2.72k stars 342 forks source link

请问,我已经添加 SET_PUBLIC_PATH 环境变量,为何 本地访问 __webpack_public_path__ 还是 undefined #861

Closed ThenMorning closed 5 years ago

ThenMorning commented 5 years ago

请问,我已经添加 SET_PUBLIC_PATH 环境变量,为何 本地访问 webpack_public_path 还是 undefined 我是模板与资源2台服务器, 运行时设置webpack_public_path 应该就是用这个方案吧? 这是我的代码,在index.js最上方 引入,可以帮忙看看么 image

Originally posted by @WinwardZ in https://github.com/sorrycc/roadhog/pull/633/commits/d6cc2921707ef621c8e863627907dd5a7c5a7183

ThenMorning commented 5 years ago

image

ThenMorning commented 5 years ago

已经看到 demo,我先按照demo试一下 https://github.com/sorrycc/roadhog/blob/master/examples/dead-simple/public/index.html

ThenMorning commented 5 years ago

已经解决