fix: fix stats display when chunkFilename contains query string (#4359)

(cherry picked from commit 42ecd08d35)
This commit is contained in:
李枨煊
2019-07-29 15:35:13 +08:00
committed by Haoqun Jiang
parent fb738a2921
commit bb2e3e7217

View File

@@ -4,6 +4,7 @@ module.exports = function formatStats (stats, dir, api) {
const zlib = require('zlib')
const chalk = require('chalk')
const ui = require('cliui')({ width: 80 })
const url = require('url');
const json = stats.toJson({
hash: false,
@@ -20,6 +21,10 @@ module.exports = function formatStats (stats, dir, api) {
const isCSS = val => /\.css$/.test(val)
const isMinJS = val => /\.min\.js$/.test(val)
assets = assets
.map(a => {
a.name = url.parse(a.name).pathname
return a
})
.filter(a => {
if (seenNames.has(a.name)) {
return false