Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack-contrib/style-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.20.1
Choose a base ref
...
head repository: webpack-contrib/style-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.20.2
Choose a head ref
  • 3 commits
  • 6 files changed
  • 3 contributors

Commits on Jan 30, 2018

  1. Copy the full SHA
    91e0316 View commit details

Commits on Feb 15, 2018

  1. Copy the full SHA
    64f12dc View commit details
  2. Copy the full SHA
    0ef853b View commit details
Showing with 25 additions and 4 deletions.
  1. +10 −0 CHANGELOG.md
  2. +1 −1 README.md
  3. +1 −1 lib/urls.js
  4. +1 −1 package-lock.json
  5. +1 −1 package.json
  6. +11 −0 test/fixUrls.test.js
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="0.20.2"></a>
## [0.20.2](https://github.com/webpack-contrib/style-loader/compare/v0.20.1...v0.20.2) (2018-02-15)


### Bug Fixes

* **urls:** skip empty `url()` handling ([#304](https://github.com/webpack-contrib/style-loader/issues/304)) ([64f12dc](https://github.com/webpack-contrib/style-loader/commit/64f12dc))



<a name="0.20.1"></a>
## [0.20.1](https://github.com/webpack-contrib/style-loader/compare/v0.20.0...v0.20.1) (2018-01-26)

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ Styles are not added on `import/require()`, but instead on call to `use`/`ref`.
|**`attrs`**|`{Object}`|`{}`|Add custom attrs to `<style></style>`|
|**`transform`** |`{Function}`|`false`|Transform/Conditionally load CSS by passing a transform/condition function|
|**`insertAt`**|`{String\|Object}`|`bottom`|Inserts `<style></style>` at the given position|
|**`insertInto`**|`{String|Function}`|`<head>`|Inserts `<style></style>` into the given position|
|**`insertInto`**|`{String\|Function}`|`<head>`|Inserts `<style></style>` into the given position|
|**`singleton`**|`{Boolean}`|`undefined`|Reuses a single `<style></style>` element, instead of adding/removing individual elements for each required module.|
|**`sourceMap`**|`{Boolean}`|`false`|Enable/Disable Sourcemaps|
|**`convertToAbsoluteUrls`**|`{Boolean}`|`false`|Converts relative URLs to absolute urls, when source maps are enabled|
2 changes: 1 addition & 1 deletion lib/urls.js
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ module.exports = function (css) {
.replace(/^'(.*)'$/, function(o, $1){ return $1; });

// already a full url? no change
if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
return fullMatch;
}

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "style-loader",
"version": "0.20.1",
"version": "0.20.2",
"author": "Tobias Koppers @sokra",
"description": "style loader module for webpack",
"engines": {
11 changes: 11 additions & 0 deletions test/fixUrls.test.js
Original file line number Diff line number Diff line change
@@ -143,6 +143,17 @@ describe("fix urls tests", function() {
assertUrl("body { background-image:url(#bg.jpg); }");
});

// empty urls
it("Empty url should be skipped", function() {
assertUrl("body { background-image:url(); }");
assertUrl("body { background-image:url( ); }");
assertUrl("body { background-image:url(\n); }");
assertUrl("body { background-image:url(''); }");
assertUrl("body { background-image:url(' '); }");
assertUrl("body { background-image:url(\"\"); }");
assertUrl("body { background-image:url(\" \"); }");
});

// rooted urls
it("Rooted url", function() {
assertUrl(