-
Notifications
You must be signed in to change notification settings - Fork 212
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
My issue is that this tutorial is too awesome #18
Comments
I might just never close it haha. Thank you for the warm words! |
Thank you @AriaFallah! This was the tutorial that helped me jump into Webpack and understand how to set it up for live reloads and rapid development. When do you think you will have one with react? I know that with this tool you can update component's code without loosing the state. Many thanks! |
For the time being, I've become really busy, and I don't think I'll put out future parts for at least another week or two. Another part of the reason I've held off is because it's extremely trivial to finally hook up HMR to React, and I've been wanting to find out if there's other content I can add to part3. However, since I just said it was easy, I might as well put up a quick example. I haven't tested this, but the process would be something like this: Using https://github.com/gaearon/react-transform-boilerplate as a reference: Add these two plugins to your webpack config (although you should already have the HotModuleReplacement one): plugins: [
// ...other plugins
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
], Install these babel presets:
Change your .babelrc to {
"presets": ["react", "es2015", "stage-2"],
"env": {
"development": {
"presets": ["react-hmre"]
}
}
} And I think that should be it. Again, I'm not sure if I got everything right because, unlike the tutorials, I wrote this quickly without testing. If you actually try this out, let me know if it works. At the very least I hope that helps. |
same here, thanks for putting this together. |
Hey@AriaFallah, Thank you this series on webpack is shining a new light for how I understand webpack. Not sure if that's been affecting other users. |
@felicedeNigris that's interesting. That's how you would do hot reloading from the CLI if you didn't have it configured in you webpack.config.dev.js, but if you have the If that doesn't work check out: https://medium.com/@rajaraodv/webpacks-hmr-react-hot-loader-the-missing-manual-232336dc0d96#.cujh3xov7 It's very well written. |
Thanks for sharing the link ! |
支持下台湾的同胞,很受用,请继续加油! |
Ok, now even I can use webpack after this tutorial. Thanks |
Best webpack tutorial i'v ever seen !!! |
I wanted to say thank you as well. Absolutely wonderful tutorial for someone diving into front end! |
Hey, this tutorial is awesome, i'm really new to webpack and i have a question. When i run dev, it's supposed to output the files in dist folder? because when i use build i get the files in dist but dev doesn't. |
Hey, nice observation! I was also confused about this when I first started. First you should understand that you're running two different commands: "build": "webpack --config webpack.config.prod.js",
"dev" : "webpack-dev-server --config webpack.config.dev.js" When you run the dev config, you're not running When you run Does that make sense? |
Ohh, i get it now! It was so confusing to me and had to ask. I don't know if i did something wrong or the fact i'm using Node v7 and didnt know could be issues with webpack with this version OR i don't understand quite well how the HMR works but when i apply the changes to the HTML the console shows me that's HMR is hot reloading the app but i dont see the changes applied. Ex. A button i did in the HTML i changed the name from OK to Submit. Edit: When i refresh the page (F5) i can see the html changed. Is this a expected behavior or i'm doing something wrong? Thank you again for this tutorial! |
It's a bit hard to understand what you're asking. I would recommend either asking on Stack Overflow, or making a new issue with more details. |
Sure, thank you anyway, i'm kinda new to these stuffs and it's hard for me to explain it and english is not my native languague, heh. |
Awesome! I was try understand webpack many times before but this is really elegant tuts) I thing you can start own courses and even get some profit cauz you can extend this articles and create a good info product) |
Seriously. I've been working with Webpack for over a year, putting stuff together from bits over there, bits over here. After reading this tutorial I finally feel like its all coming together. This is a tutorial like all tutorials should be: focus on being simple, tackle one problem at a time; basic building blocks that add up, step by step, to making you feel like a developer wearing a jetpack!
Thank you 😄
PS: feel free to close this issue whenever.
The text was updated successfully, but these errors were encountered: