Best tutorial ever I have encountered on this topic! I have been frustrated many nights but this tutorial within one hour laid everything bare for me. I can now take it from here. Thanks.
Thank you for great tutorial , I would like to mention that the setting for jsx is not working (this will throw an error for the module is not found) -webpack file need a : resolve: { extensions: [".js", ".jsx"], }. - instead of "watchBaseContet" at devServer I added hot: true , open: true Thanks again :)
make sure that you have the following in your package json file under devDependencies. I installed the newest one and it gave me the error. Updating it to below worked for me! "webpack-dev-server": "^3.11.2"
replace watchContentBase with static if you get this error : "Invalid options object. Dev Server has been initialized using an options object that does not match the API schema."
Nice tutorial, very helpful. I use HtmlWebpackPlugin, it will generate HTML file for us so that we don't need to manually add script or CSS into HTML file like the example. If we need something, it will add for us.
thanks man, this setup has been killing me! This tutorial ir perfect. My only thing is: under the module.exports, make sure it reads: output: { path: path.join(__dirname, '/dist'), filename: 'index.bundle.js', }, devServer: { port: 3000, open: true, hot: true, },
For watchContentBase error just takeout the entire property as it is already enabled by default in newer versions of webpack devServer: { port: 3010, },
At 3:45 you mentioned file-loader is used to import html to our overall output whereas I know that file-loader is used to resolve import/require of files like images. Wondering why you mentioned html import?
this is a really good tutorial but i still cannot see anything on the webpage like in this example date was on the homepage .. my homepage comes blank .. i have checked the app.js file and everything still no luck .. the html page is loaded correctly and the bundle is also loaded but the bundle seams to be empty because no content is displayed on the screen .. can anyone help
I did everything the same, but keep getting this error: ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module '@babel/preset-env, @babel/preset-react'
@@codewithbubb Thank you for your quick reply! Yes I did, but unfortunately the problem remains. I did not find any solutions for that, I also tried out to utilise exactly the same versions from the mentioned packages that you did, but still did not resolve my issue:(
Hi James, I started implemeting with this video. I'm getting error at 14:22, when we first do 'npm run serve', as instructed i installed dev-seerver-package also. in the end I'm getting error at "ReactDOM.render(, appElement)" line, saying "You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.". but I configured as video suggested for JS files.
I found your tutorial helpful, but I'm having trouble getting multiple different HTML pages to work. How would I change webpack config.js to accommodate multiple pages for my website?
Great video ! But I have a case need your advise: When I make some javascript error, the page will show the error but when i solved it, the page doesn't hot reload and I need to run manual. What should I do to auto reload ?
please help! getting this error. [webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. - configuration has an unknown property 'Plugins'. These properties are valid: object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsPresets?, externalsType?, ignoreWarnings?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, snapshot?, stats?, target?, watch?, watchOptions? } -> Options object as provided by the user. For typos: please correct them. For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration. Loaders should be updated to allow passing options via loader options in module.rules. Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader: plugins: [ new webpack.LoaderOptionsPlugin({ // test: /\.xxx$/, // may apply this only for some modules options: { Plugins: … } }) ]
If we run it locally, it make build slow as it makes first complete web pack , any way to make it fast to run locally, like normal npm start when we create a app and make a small change it loads immediately but in this case it take lot of time to run locally
Nice tutorial. A small query, I am trying to update webpack-dev-server to “^4.7.3” but I am unable to start the application and ended up in some errors. Can you please help me with upgrading webpack-dev-server to “^4.7..3” Thanks & Appreciate it
@@codewithbubb i need to recreate a design from envision (im used to figma) but im new to webpack. this tutorial helped me ALOT but do you mind if i message u with a question or two?
Thanks very much for this tutorial. I am a react learner and this was by far a really good tutorial to get me up and using webpack. It seems like a lot of paid for tutorials have difficulties with webpack configurations. I wont name a couple I have done where everything comes to a halt because the tutorial is out of date for webapck configuration or not configured correctly. I really appreciated your tutorial and really appreciated your clear precise and concise explanations for the files and the code. This is my first time to your channel and I am now a subscriber and I will definitely watch your other videos. Thanks again.
Ah, thank you so much for your feedback George! Yes, that's the problem with some technologies - they get updated and become out of date so quickly. Glad you enjoyed the tutorial and glad to have you with us!
@@jayeshthanvi1115 Mind sharing your error / fix? I'm having Exit status 1 on webpack --mode production with 'npm run build' command but not sure why. Dependencies are all correct. EDIT: Nvm, it was an issue within my webpack.config.js I believe.
Great Video.. Just wanted to add that webpack will run loader in reverse order . Sass-loader converts to css file , which css-loader with turns to javascript and then style-loader will add that to the link tag in our main html file.
What about if application was created with 'npx create-react-app myApp', How to configure webpack config file if i got a new mac laptop, it logs on the browser 'bundle.js' not the actual file name ?
Great question! I haven't used styled components much to be honest but as far as I know, it's just a JavaScript library so it shouldn't need to have any additional config in webpack. I saw this in their docs but it's just really for server-side rendering: styled-components.com/docs/tooling
First, congrats for the video, and thanks for your colab for our community! I just have one question, how would I add this Br or Gzip technics on a existing project create by CRA? Is it possible? Would adding webpack.config.js file work? Thanks!
can you guys help me, I can't install webpack-dev-server. Loading bar never running when I type commad npm install webpack-dev-server or npm run serve and type Y to install webpack-dev-server.
nothing but you may not want all the features that comes with the default webpack package. This allows you to use only what you need, resulting in a more efficient environment.