File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ These can be accessed using the object literal syntax; eg styles['delete'] inste
82
82
// Prefix banner to CSS module
83
83
cssModuleDefinition = query . banner + '\n' + cssModuleDefinition ;
84
84
}
85
- persist . writeToFileIfChanged ( cssModuleInterfaceFilename , cssModuleDefinition ) ;
85
+ persist . writeToFileIfChanged ( cssModuleInterfaceFilename , cssModuleDefinition , query ) ;
86
86
// mock async step 3 - make `async` return the actual callback again before calling the 'real' css-loader
87
87
delegateToCssLoader ( this , input , callback ) ;
88
88
} ;
Original file line number Diff line number Diff line change 1
1
import fs from 'graceful-fs' ;
2
2
import os from 'os' ;
3
3
4
- export const writeToFileIfChanged = ( filename , content ) => {
4
+ export const writeToFileIfChanged = ( filename , content , options ) => {
5
5
if ( fs . existsSync ( filename ) ) {
6
6
const currentInput = fs . readFileSync ( filename , 'utf-8' ) ;
7
7
8
8
if ( currentInput !== content ) {
9
- writeFile ( filename , content ) ;
9
+ writeFile ( filename , content , options ) ;
10
10
}
11
11
} else {
12
- writeFile ( filename , content ) ;
12
+ writeFile ( filename , content , options ) ;
13
13
}
14
14
} ;
15
15
16
- const writeFile = ( filename , content ) => {
16
+ const writeFile = ( filename , content , options ) => {
17
17
//Replace new lines with OS-specific new lines
18
- content = content . replace ( / \n / g, os . EOL ) ;
18
+ content = content . replace ( / \n / g, options . EOL || os . EOL ) ;
19
19
20
20
fs . writeFileSync ( filename , content , 'utf8' ) ;
21
21
} ;
You can’t perform that action at this time.
0 commit comments