File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 56
56
"node" : " >= 6.11.5"
57
57
},
58
58
"peerDependencies" : {
59
+ "style-loader" : " ^0.20.3" ,
59
60
"webpack" : " ^4.4.0"
60
61
},
61
62
"pre-commit" : " lint-staged" ,
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import NodeTargetPlugin from 'webpack/lib/node/NodeTargetPlugin';
7
7
import LibraryTemplatePlugin from 'webpack/lib/LibraryTemplatePlugin' ;
8
8
import SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin' ;
9
9
import LimitChunkCountPlugin from 'webpack/lib/optimize/LimitChunkCountPlugin' ;
10
+ import styleLoader from 'style-loader' ;
10
11
11
12
const NS = path . dirname ( fs . realpathSync ( __filename ) ) ;
12
13
@@ -25,8 +26,13 @@ const findModuleById = (modules, id) => {
25
26
return null ;
26
27
} ;
27
28
28
- export function pitch ( request ) {
29
+ export function pitch ( request ) { // eslint-disable-line consistent-return
29
30
const query = loaderUtils . getOptions ( this ) || { } ;
31
+
32
+ if ( query . hmr !== false ) {
33
+ return styleLoader . pitch ( request ) ;
34
+ }
35
+
30
36
const loaders = this . loaders . slice ( this . loaderIndex + 1 ) ;
31
37
this . addDependency ( this . resourcePath ) ;
32
38
const childFilename = '*' ; // eslint-disable-line no-path-concat
Original file line number Diff line number Diff line change @@ -7436,6 +7436,13 @@ strip-json-comments@^2.0.1, strip-json-comments@~2.0.1:
7436
7436
version "2.0.1"
7437
7437
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
7438
7438
7439
+ style-loader@^0.20.3 :
7440
+ version "0.20.3"
7441
+ resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.20.3.tgz#ebef06b89dec491bcb1fdb3452e913a6fd1c10c4"
7442
+ dependencies :
7443
+ loader-utils "^1.1.0"
7444
+ schema-utils "^0.4.5"
7445
+
7439
7446
suffix@^0.1.0 :
7440
7447
version "0.1.0"
7441
7448
resolved "https://registry.yarnpkg.com/suffix/-/suffix-0.1.0.tgz#3e46966de56af17600385e58db8ec659dd797907"
You can’t perform that action at this time.
0 commit comments