File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ function formatValue(value) {
34
34
prefix : '' ,
35
35
suffix : ',' ,
36
36
suffixLastItem : false ,
37
- }
37
+ } ;
38
38
return '(\n' + objToValue ( value , opts ) + '\n)' ;
39
39
}
40
40
Original file line number Diff line number Diff line change 3
3
const loaderUtils = require ( 'loader-utils' ) ;
4
4
const fs = require ( 'fs' ) ;
5
5
const convert = require ( './convert' ) ;
6
+ const path = require ( 'path' ) ;
6
7
7
8
const loader = function ( content )
8
9
{
@@ -16,12 +17,12 @@ const loader = function(content)
16
17
config . files = [ config . files ] ;
17
18
}
18
19
config . files . forEach ( ( path ) => {
19
- path = path . replace ( / [ " ' ] / g, '' ) ;
20
- this . addDependency ( path ) ;
21
20
if ( path . endsWith ( '.json' ) ) {
22
21
Object . assign ( vars , JSON . parse ( fs . readFileSync ( path , 'utf8' ) ) ) ;
23
22
}
24
23
if ( path . endsWith ( '.js' ) ) {
24
+ const resolvedFilePath = path . resolve ( path . replace ( / [ " ' ] / g, '' ) ) ;
25
+ delete require . cache [ resolvedFilePath ] ;
25
26
Object . assign ( vars , require ( path ) ) ;
26
27
}
27
28
} )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @epegzz/sass-vars-loader" ,
3
- "version" : " 1.1 .0" ,
3
+ "version" : " 1.2 .0" ,
4
4
"author" : " Daniel Schäfer <epegzz@gmail.com>" ,
5
5
"description" : " A SASS vars loader for Webpack. Load global SASS vars from JS/JSON files or from Webpack config." ,
6
6
"files" : [
You can’t perform that action at this time.
0 commit comments