File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ function formatValue(value) {
3434 prefix : '' ,
3535 suffix : ',' ,
3636 suffixLastItem : false ,
37- }
37+ } ;
3838 return '(\n' + objToValue ( value , opts ) + '\n)' ;
3939 }
4040
Original file line number Diff line number Diff line change 33const loaderUtils = require ( 'loader-utils' ) ;
44const fs = require ( 'fs' ) ;
55const convert = require ( './convert' ) ;
6+ const path = require ( 'path' ) ;
67
78const loader = function ( content )
89{
@@ -16,12 +17,12 @@ const loader = function(content)
1617 config . files = [ config . files ] ;
1718 }
1819 config . files . forEach ( ( path ) => {
19- path = path . replace ( / [ " ' ] / g, '' ) ;
20- this . addDependency ( path ) ;
2120 if ( path . endsWith ( '.json' ) ) {
2221 Object . assign ( vars , JSON . parse ( fs . readFileSync ( path , 'utf8' ) ) ) ;
2322 }
2423 if ( path . endsWith ( '.js' ) ) {
24+ const resolvedFilePath = path . resolve ( path . replace ( / [ " ' ] / g, '' ) ) ;
25+ delete require . cache [ resolvedFilePath ] ;
2526 Object . assign ( vars , require ( path ) ) ;
2627 }
2728 } )
Original file line number Diff line number Diff line change 11{
22 "name" : " @epegzz/sass-vars-loader" ,
3- "version" : " 1.1 .0" ,
3+ "version" : " 1.2 .0" ,
44 "author" :
" Daniel Schäfer <[email protected] >" ,
55 "description" : " A SASS vars loader for Webpack. Load global SASS vars from JS/JSON files or from Webpack config." ,
66 "files" : [
You can’t perform that action at this time.
0 commit comments