You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-46
Original file line number
Diff line number
Diff line change
@@ -669,13 +669,7 @@ export default CustomSquare;
669
669
Type:
670
670
671
671
```ts
672
-
typestyleTagTransform=
673
-
|string
674
-
| ((
675
-
css:string,
676
-
styleElement:HTMLStyleElement,
677
-
options:Record<string, any>,
678
-
) =>void);
672
+
typestyleTagTransform=string;
679
673
```
680
674
681
675
Default: `undefined`
@@ -688,41 +682,9 @@ Allows to setup absolute path to custom function that allows to override default
688
682
>
689
683
> Do not forget that this code will be used in the browser and not all browsers support latest ECMA features like `let`, `const`, `arrow function expression` and etc, we recommend use only ECMA 5 features, but it is depends what browsers you want to support
690
684
691
-
**webpack.config.js**
692
-
693
-
```js
694
-
module.exports= {
695
-
module: {
696
-
rules: [
697
-
{
698
-
test:/\.css$/i,
699
-
use: [
700
-
{
701
-
loader:"style-loader",
702
-
options: {
703
-
injectType:"styleTag",
704
-
styleTagTransform:require.resolve("module-path"),
705
-
},
706
-
},
707
-
"css-loader",
708
-
],
709
-
},
710
-
],
711
-
},
712
-
};
713
-
```
714
-
715
-
#### `function`
716
-
717
-
Transform tag and css when insert 'style' tag into the DOM.
718
-
719
-
> **Warning**
720
-
>
721
-
> Do not forget that this code will be used in the browser and not all browsers support latest ECMA features like `let`, `const`, `arrow function expression` and etc, we recommend use only ECMA 5 features, but it is depends what browsers you want to support
722
-
723
685
> **Warning**
724
686
>
725
-
> Do not forget that some DOM methods may not be available in older browsers, we recommended use only [DOM core level 2 properties](https://caniuse.com/#search=DOM%20Core), but it is depends what browsers you want to support
687
+
> Do not forget that some DOM methods may not be available in older browsers, we recommended use only [DOM core level 2 properties](https://caniuse.com/#search=DOM%20Core), but it depends what browsers you want to support
Copy file name to clipboardExpand all lines: test/__snapshots__/styleTagTransform-option.test.js.snap
-26
Original file line number
Diff line number
Diff line change
@@ -26,32 +26,6 @@ exports[`"styleTagTransform" option should "styleTagTransform" function path add
26
26
27
27
exports[`"styleTagTransform" option should "styleTagTransform" function path added to buildDependencies when injectType lazyStyleTag: warnings 1`] =`[]`;
28
28
29
-
exports[`"styleTagTransform" option should work when the "styleTagTransform" option is not specify and injectType lazyStyleTag: DOM 1`] =`
0 commit comments