File tree 1 file changed +11
-3
lines changed
packages/@vue/cli-service/lib
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -135,14 +135,22 @@ class PluginAPI {
135
135
const fs = require ( 'fs' )
136
136
const cacheDirectory = this . resolve ( `node_modules/.cache/${ id } ` )
137
137
138
+ // replace \r\n to \n generate consistent hash
139
+ const fmtFunc = conf => {
140
+ if ( typeof conf == 'function' ) {
141
+ return conf . toString ( ) . replace ( / \r \n ? / g, "\n" )
142
+ }
143
+ return conf ;
144
+ } ;
145
+
138
146
const variables = {
139
147
partialIdentifier,
140
148
'cli-service' : require ( '../package.json' ) . version ,
141
149
'cache-loader' : require ( 'cache-loader/package.json' ) . version ,
142
150
env : process . env ,
143
151
config : [
144
- this . service . projectOptions . chainWebpack ,
145
- this . service . projectOptions . configureWebpack
152
+ fmtFunc ( this . service . projectOptions . chainWebpack ) ,
153
+ fmtFunc ( this . service . projectOptions . configureWebpack )
146
154
]
147
155
}
148
156
@@ -159,7 +167,7 @@ class PluginAPI {
159
167
for ( const file of configFiles ) {
160
168
const content = readConfig ( file )
161
169
if ( content ) {
162
- variables . configFiles = content
170
+ variables . configFiles = content . replace ( / \r \n ? / g , "\n" ) ;
163
171
break
164
172
}
165
173
}
You can’t perform that action at this time.
0 commit comments