Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b4ea648

Browse filesBrowse files
author
wilsonsliu
committed
fix: genCacheConfig return different result because linebreak
1 parent d5ed280 commit b4ea648
Copy full SHA for b4ea648

File tree

Expand file treeCollapse file tree

1 file changed

+11
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-3
lines changed

‎packages/@vue/cli-service/lib/PluginAPI.js

Copy file name to clipboardExpand all lines: packages/@vue/cli-service/lib/PluginAPI.js
+11-3Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,22 @@ class PluginAPI {
135135
const fs = require('fs')
136136
const cacheDirectory = this.resolve(`node_modules/.cache/${id}`)
137137

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+
138146
const variables = {
139147
partialIdentifier,
140148
'cli-service': require('../package.json').version,
141149
'cache-loader': require('cache-loader/package.json').version,
142150
env: process.env,
143151
config: [
144-
this.service.projectOptions.chainWebpack,
145-
this.service.projectOptions.configureWebpack
152+
fmtFunc(this.service.projectOptions.chainWebpack),
153+
fmtFunc(this.service.projectOptions.configureWebpack)
146154
]
147155
}
148156

@@ -159,7 +167,7 @@ class PluginAPI {
159167
for (const file of configFiles) {
160168
const content = readConfig(file)
161169
if (content) {
162-
variables.configFiles = content
170+
variables.configFiles = content.replace(/\r\n?/g, '\n')
163171
break
164172
}
165173
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.