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

Javascript Webpack: Fix the url being broken #28556

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion javascript/organizing_your_javascript_code/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
<div class="lesson-content__panel" markdown="1">

1. Code along with [Webpack's "Asset Management" tutorial](https://webpack.js.org/guides/asset-management/) to learn how to use webpack to manage your website's assets.
1. This short article and video demonstrate [how to install `html-webpack-plugin` and set different options](https://rapidevelop.org/webpack/setup-html-webpack-plugin) on it (note that you do not need to include some of the options mentioned as they are already [`html-webpack-plugin`'s default settings](https://github.com/jantimon/html-webpack-plugin#options)). Whilst the written instructions do not show any code unlike the video, any options would be set just like the `template` option example shown above.
1. This short article and video demonstrate [how to install `html-webpack-plugin` and set different options](https://web.archive.org/web/20240520022915/https://rapidevelop.org/webpack/setup-html-webpack-plugin) on it (note that you do not need to include some of the options mentioned as they are already [`html-webpack-plugin`'s default settings](https://github.com/jantimon/html-webpack-plugin#options)). Whilst the written instructions do not show any code unlike the video, any options would be set just like the `template` option example shown above.
1. [Webpack's "Output Management" tutorial](https://webpack.js.org/guides/output-management/) also gives an example of using `html-webpack-plugin` but does not demonstrate using the template option. It also starts by demonstrating how to configure multiple entry points - you are unlikely to need this feature for the projects in this part of the course.
1. The first part of [Webpack's "Development" tutorial](https://webpack.js.org/guides/development/) (up until “Choosing a Development Tool”) talks about source maps, a handy way to track down which source file (index.js, a.js, b.js) an error is coming from when you use webpack to bundle them together. This is essential to debugging bundled code in your browser's DevTools. If the error comes from b.js the error will reference that file instead of the bundle. It also walks through an example of the `--watch` feature and `webpack-dev-server` package, either of which will prove invaluable when working with webpack.
1. If you use both `webpack-dev-server` and `html-webpack-plugin`, you will want to add your template HTML file to the [list of files watched for changes](https://webpack.js.org/configuration/dev-server/#devserverwatchfiles). This ensures that the server and page automatically reloads whenever you modify your template HTML file.
Expand Down
Loading