From 7b0ea1dd494e378710012ab2a6fcc7757329ef8c Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Wed, 12 May 2021 17:32:46 -0700 Subject: [PATCH 1/4] Clarify behavior of URL option --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index fd36a1b0..22af5f48 100644 --- a/README.md +++ b/README.md @@ -125,8 +125,7 @@ module.exports = { Type: `Boolean|Function` Default: `true` -Enables/Disables `url`/`image-set` functions handling. -Control `url()` resolving. Absolute paths and root-relative URLs now resolving(Version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25) and above). +Enables/Disables `url`/`image-set` functions handling. If set to `false`, `css-loader` will not parse any paths specified in `url` or `image-set`. A function can also be passed to control this behavior dynamically based on the path to the asset. Starting with (version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25), absolute paths are parsed relative to the server root. Examples resolutions: From 093ea7df8e0767bc7b453f2f3b35db86fb616faa Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Wed, 12 May 2021 17:38:17 -0700 Subject: [PATCH 2/4] Fix typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22af5f48..5fb355a8 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ module.exports = { Type: `Boolean|Function` Default: `true` -Enables/Disables `url`/`image-set` functions handling. If set to `false`, `css-loader` will not parse any paths specified in `url` or `image-set`. A function can also be passed to control this behavior dynamically based on the path to the asset. Starting with (version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25), absolute paths are parsed relative to the server root. +Enables/Disables handling the CSS functions `url` and `image-set`. If set to `false`, `css-loader` will not parse any paths specified in `url` or `image-set`. A function can also be passed to control this behavior dynamically based on the path to the asset. Starting with version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25), absolute paths are parsed based on the server root. Examples resolutions: From 04a5b3012c73069ed46caa20380ea82109758887 Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Wed, 12 May 2021 17:42:43 -0700 Subject: [PATCH 3/4] Clarify breaking change in changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e1f8886..16d1fb82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -180,12 +180,11 @@ All notable changes to this project will be documented in this file. See [standa * the `onlyLocals` option was moved and renamed to the `modules.exportOnlyLocals` option * function arguments of the `import` option were changed, it is now `function(url, media, resourcePath) {}` * inline syntax was changed, please write `~` before the file request, i.e. rewrite `url(~!!loader!package/img.png)` to `url(!!loader!~package/img.png)` - + * Improve `url()` resolving algorithm. Absolute paths are now parsed based on the server root and not ignored. This can break builds which relied on absolute paths to point to the asset directory. ([bc19ddd](https://github.com/webpack-contrib/css-loader/commit/bc19ddd8779dafbc2a420870a3cb841041ce9c7c)) ### Features * `@value` supports importing `url()` ([#1126](https://github.com/webpack-contrib/css-loader/issues/1126)) ([7f49a0a](https://github.com/webpack-contrib/css-loader/commit/7f49a0a6047846bb2e432558365e19d4a0dfb366)) -* improve `url()` resolving algorithm ([bc19ddd](https://github.com/webpack-contrib/css-loader/commit/bc19ddd8779dafbc2a420870a3cb841041ce9c7c)) * named export for locals ([#1108](https://github.com/webpack-contrib/css-loader/issues/1108)) ([d139ec1](https://github.com/webpack-contrib/css-loader/commit/d139ec1d763f9944550b31f2a75183e488dd1224)) * respected the `style` field from package.json ([#1099](https://github.com/webpack-contrib/css-loader/issues/1099)) ([edf5347](https://github.com/webpack-contrib/css-loader/commit/edf5347e4203a62e50b87248a83da198afdc6eba)) * support `file:` protocol ([5604205](https://github.com/webpack-contrib/css-loader/commit/560420567eb0e1a635648b7f4ff0365db475384c)) From b583bdb2ee0ca491726f78b7d1795f5c7261ff6c Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Thu, 13 May 2021 10:23:06 -0700 Subject: [PATCH 4/4] Add back new feature section --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d1fb82..94ccf2fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -180,11 +180,12 @@ All notable changes to this project will be documented in this file. See [standa * the `onlyLocals` option was moved and renamed to the `modules.exportOnlyLocals` option * function arguments of the `import` option were changed, it is now `function(url, media, resourcePath) {}` * inline syntax was changed, please write `~` before the file request, i.e. rewrite `url(~!!loader!package/img.png)` to `url(!!loader!~package/img.png)` - * Improve `url()` resolving algorithm. Absolute paths are now parsed based on the server root and not ignored. This can break builds which relied on absolute paths to point to the asset directory. ([bc19ddd](https://github.com/webpack-contrib/css-loader/commit/bc19ddd8779dafbc2a420870a3cb841041ce9c7c)) + * `url()` resolving algorithm now handles absolute paths instead of ignoring them. This can break builds which relied on absolute paths to refer to the asset directory. ([bc19ddd](https://github.com/webpack-contrib/css-loader/commit/bc19ddd8779dafbc2a420870a3cb841041ce9c7c)) ### Features * `@value` supports importing `url()` ([#1126](https://github.com/webpack-contrib/css-loader/issues/1126)) ([7f49a0a](https://github.com/webpack-contrib/css-loader/commit/7f49a0a6047846bb2e432558365e19d4a0dfb366)) +* improve `url()` resolving algorithm to support more path types ([bc19ddd](https://github.com/webpack-contrib/css-loader/commit/bc19ddd8779dafbc2a420870a3cb841041ce9c7c)) * named export for locals ([#1108](https://github.com/webpack-contrib/css-loader/issues/1108)) ([d139ec1](https://github.com/webpack-contrib/css-loader/commit/d139ec1d763f9944550b31f2a75183e488dd1224)) * respected the `style` field from package.json ([#1099](https://github.com/webpack-contrib/css-loader/issues/1099)) ([edf5347](https://github.com/webpack-contrib/css-loader/commit/edf5347e4203a62e50b87248a83da198afdc6eba)) * support `file:` protocol ([5604205](https://github.com/webpack-contrib/css-loader/commit/560420567eb0e1a635648b7f4ff0365db475384c))