File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @idrinth/rollup-plugin-react-modular-css" ,
3
- "version" : " 1.0.2 " ,
3
+ "version" : " 1.0.3 " ,
4
4
"description" : " Provides a plugin to split css files out separately." ,
5
5
"main" : " src/index.js" ,
6
6
"repository" : {
Original file line number Diff line number Diff line change 1
-
2
- const header = document . getElementsByTagName ( 'header' ) [ 0 ] ;
1
+ const global = window || this || { } ;
2
+ const header = global . document . getElementsByTagName ( 'header' ) [ 0 ] ;
3
3
export default ( hash : string , name : string ) => {
4
4
const path = `/assets/${ name } -${ hash } .min.css` ;
5
- if ( document . querySelector ( `link[href='${ path } ']` ) ) {
5
+ if ( global . document . querySelector ( `link[href='${ path } ']` ) ) {
6
6
return ;
7
7
}
8
- const style = document . createElement ( 'link' ) ;
8
+ const style = global . document . createElement ( 'link' ) ;
9
9
style . setAttribute ( 'rel' , 'stylesheet' ) ;
10
10
style . setAttribute ( 'href' , path ) ;
11
11
header . appendChild ( style ) ;
You can’t perform that action at this time.
0 commit comments