Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant resolve module 'babel' when running dist #301

Open
AlfredOdling opened this issue Nov 16, 2016 · 5 comments
Open

Cant resolve module 'babel' when running dist #301

AlfredOdling opened this issue Nov 16, 2016 · 5 comments

Comments

@AlfredOdling
Copy link

Im trying to deploy my app and been trying so hard to do it. I dont get it, it should pretty straightforward to do this right? How do you deploy to heroku? Im telling heroku to run: "npm run dist && npm run start". Please check my question on stackoverflow: http://stackoverflow.com/questions/40637447/cant-resolve-module-babel-when-running-dist

@stylesuxx
Copy link
Contributor

stylesuxx commented Nov 22, 2016

npm run dist bundles it, and you should be able to serve it with npm run serve:dist.
Also please post the error messages if possible.

@AlfredOdling
Copy link
Author

But the server doesn´t get the env.process.PORT variable set. Is that outside of the scope of the implemented server, or can I use that server for dist?

@sthzg
Copy link
Member

sthzg commented Nov 23, 2016

IMO there are two answers to this question.

Setting the port through an ENV var:

Setting the port is a planned feature that I hope to implement soon. You could subscribe to react-webpack-generators/react-webpack-template#68 (and also +1 it if you feel it would be helpful).

Using the server for running in production:

Besides the port issue, npm run serve:dist still only uses the webpack-dev-server to serve the project. This is helpful for testing the created code bundle, but it is not suitable as a production server.

@AlfredOdling
Copy link
Author

Okey, as a tip for improvement I would strongly suggest putting this info about deployment in the documents!

@sthzg
Copy link
Member

sthzg commented Nov 23, 2016

@AlfredOdling that's a good suggestion, I have added an issue for that (#311) and hope to update it along with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants