Skip to content

Commit

Permalink
fix(core): Fixed sourcemap and hash file generation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Marinerer committed Oct 26, 2023
1 parent bcf40b5 commit 9d5942b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/core/build/comm.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,15 @@ function outputFiles(processes, {
filter,
sourcemap: hasSourcemap
}) {
// 1. 写入sourcemap文件
if (hasSourcemap) {
processes.push(sourcemaps.write('.'))
}

if (fileHash) {
const fileFilter = createFilter(filter)

// 1. 写入sourcemap文件
hasSourcemap && processes.push(sourcemaps.write('.'))

// 2. 是否生成 rev文件
// 2.1 不生成 rev文件
// 2. 是否生成 hash文件
// 2.1 不生成 hash文件
fileHash === '?' && processes.push(gulp.dest(dest))
// 2.2 是否过滤指定文件
if (fileFilter) {
Expand All @@ -163,7 +164,7 @@ function outputFiles(processes, {
} else {
processes.push(rev())
}
// 2.3 生成 rev文件 和 sourcemap文件
// 2.3 生成 hash文件
fileHash !== '?' && processes.push(gulp.dest(dest))

// 3. 生成 manifest.json
Expand Down

0 comments on commit 9d5942b

Please sign in to comment.