File tree 1 file changed +8
-7
lines changed
packages/vite/src/node/plugins
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -47,14 +47,12 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
47
47
content : string | Uint8Array ,
48
48
type : WriteType ,
49
49
maxLength : number ,
50
+ outDir = config . build . outDir ,
50
51
compressedSize = ''
51
52
) {
52
- const outDir =
53
+ outDir =
53
54
normalizePath (
54
- path . relative (
55
- config . root ,
56
- path . resolve ( config . root , config . build . outDir )
57
- )
55
+ path . relative ( config . root , path . resolve ( config . root , outDir ) )
58
56
) + '/'
59
57
const kibs = content . length / 1024
60
58
const sizeColor = kibs > chunkLimit ? colors . yellow : colors . dim
@@ -137,7 +135,7 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
137
135
}
138
136
} ,
139
137
140
- async writeBundle ( _ , output ) {
138
+ async writeBundle ( { dir : outDir } , output ) {
141
139
let hasLargeChunks = false
142
140
143
141
if ( shouldLogInfo ) {
@@ -161,14 +159,16 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
161
159
chunk . code ,
162
160
WriteType . JS ,
163
161
longest ,
162
+ outDir ,
164
163
await getCompressedSize ( chunk . code )
165
164
)
166
165
if ( chunk . map ) {
167
166
printFileInfo (
168
167
chunk . fileName + '.map' ,
169
168
chunk . map . toString ( ) ,
170
169
WriteType . SOURCE_MAP ,
171
- longest
170
+ longest ,
171
+ outDir
172
172
)
173
173
}
174
174
}
@@ -190,6 +190,7 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
190
190
? WriteType . SOURCE_MAP
191
191
: WriteType . ASSET ,
192
192
longest ,
193
+ outDir ,
193
194
isCSS ? await getCompressedSize ( chunk . source ) : undefined
194
195
)
195
196
}
You can’t perform that action at this time.
0 commit comments