是否有可能覆盖开发环境的react-script中的publicPath。我使用symfony,并且我在twig中包含了react应用程序,所以我不得不更改资源以从http://localhost:3000/static/js/bundle.js提供服务--这很好用,但我对静态文件有问题,因为它们在浏览器中呈现为'/ static /media/logo.813ua.png‘,而我当前的url是http://localhost:8000
我所做的是在webpack.config.dev.js中运行纱线弹出和修改: var publicPath = 'http://localhost:3000/‘,一切正常,但我不想弹出,所以有没有可能在不弹出反应脚本的情况下这样做?
发布于 2017-06-16 20:34:17
使用with process.env.PORT (package.json)指定端口
"scripts": {
"start": "PORT=1234 react-scripts start"
}https://stackoverflow.com/questions/43419053
复制相似问题