From 8d0ba6feeb9eb9a269dd02a3a7624aad3184b7f0 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Thu, 7 Dec 2017 14:54:26 +0300 Subject: [PATCH] fix: `singleton` option behavior when boolean --- README.md | 3 ++- lib/addStyles.js | 2 +- test/basicTest.js | 23 ++++++++++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0afaf089..3cece161 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ Styles are not added on `import/require()`, but instead on call to `use`/`ref`. |**`transform`** |`{Function}`|`false`|Transform/Conditionally load CSS by passing a transform/condition function| |**`insertAt`**|`{String\|Object}`|`bottom`|Inserts `` at the given position| |**`insertInto`**|`{String}`|``|Inserts `` into the given position| +|**`singleton`**|`{Boolean}`|`undefined`|Reuses a single `` 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| @@ -331,7 +332,7 @@ You can also insert the styles into a [ShadowRoot](https://developer.mozilla.org ### `singleton` -If defined, the style-loader will reuse a single `` element, instead of adding/removing individual elements for each required module. > ℹ️ This option is on by default in IE9, which has strict limitations on the number of style tags allowed on a page. You can enable or disable it with the singleton option. diff --git a/lib/addStyles.js b/lib/addStyles.js index ad3c393b..91f9d32d 100644 --- a/lib/addStyles.js +++ b/lib/addStyles.js @@ -64,7 +64,7 @@ module.exports = function(list, options) { // Force single-tag solution on IE6-9, which has a hard limit on the # of ` + ].join("\n"); + + runCompilerTest(expected, done); + }); // it singleton + it("attrs", function(done) { // Setup styleLoaderOptions.attrs = {id: 'style-tag-id'};