зеркало из https://github.com/mozilla/treeherder.git
Neutrino 4 configures `file-loader` as the loader for HTML (rather than the more usual `html-loader`), which means the HTML is not parsed to look for further dependencies such as `<img src="...">` tags. Our custom Neutrino config overrode that to `raw-loader` (presumably to work around bugs caused by the use of `file-loader`), which doesn't parse HTML either. Instead, these assets were being manually copied to `dist/img/` by `neutrino-custom/production.js`'s `CopyPlugin` rule, effectively circumventing the webpack build process. Newer Neutrino correctly uses `html-loader`, causing our HTML to be parsed during the webpack build for the first time. However now that the images are being resolved at build time rather than runtime, the relative paths need to be updated to account for the directory layout differences between `src/` and `dist/`, to prevent build errors. A significant benefit of this change is that images referenced from HTML will now be output with hashed filenames, meaning they get given long-lived `Cache-Control` headers by WhiteNoise. See: https://webpack.js.org/loaders/file-loader/ https://webpack.js.org/loaders/raw-loader/ https://webpack.js.org/loaders/html-loader/ |
||
---|---|---|
.. | ||
logviewer | ||
main | ||
perf |