Skip to content

Commit d4e9c31

Browse files
authoredFeb 18, 2023
fix: null is invalid for sources and file (#242)
1 parent 6032003 commit d4e9c31

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/Bundle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default class Bundle {
144144
});
145145

146146
return {
147-
file: options.file ? options.file.split(/[/\\]/).pop() : null,
147+
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
148148
sources: this.uniqueSources.map((source) => {
149149
return options.file ? getRelativePath(options.file, source.filename) : source.filename;
150150
}),

‎src/MagicString.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ export default class MagicString {
163163
});
164164

165165
return {
166-
file: options.file ? options.file.split(/[/\\]/).pop() : null,
167-
sources: [options.source ? getRelativePath(options.file || '', options.source) : null],
168-
sourcesContent: options.includeContent ? [this.original] : [null],
166+
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
167+
sources: [options.source ? getRelativePath(options.file || '', options.source) : (options.file || '')],
168+
sourcesContent: options.includeContent ? [this.original] : undefined,
169169
names,
170170
mappings: mappings.raw,
171171
};

0 commit comments

Comments
 (0)
Please sign in to comment.