Even if it's only a simple one, we'll need to serve up an HTML file to run our JavaScript app. We can hardcode the bundle path into a script tag, but then if we want to change our bundle name, we need to update that in our webpack config and in our html file. In this lesson, we'll see how to use the HtmlWebpackPlugin
to inject the script tag for our bundle into an HTML template file.
At this step, I am getting the following error: Uncaught Error: Target container is not a DOM element in console and in terminal, a verbose error log saying how it doesnt recognize html template. Please help with this. Thanks!
You can try downloading the github code from this episode and compare. I had a problem too earlier, the console is outputting a.render is not a function
. Silly typo where I imported react
instead of react-dom
.
You can try downloading the github code from this episode and compare. I had a problem too earlier, the console is outputting a.render is not a function
. Silly typo where I imported react
instead of react-dom
.
I installed latest htmlwebpackplugin and configured but when I ran the build I received this error "TypeError: Cannot read property 'tap' of undefined" in the terminal
I fixed by installing the same version in the video https://github.com/avanslaars/egghead-react-boilerplate/blob/09_html_webpack/package.json#L27 (not the latest version)