Skip to content

Commit

Permalink
fix: null is invalid for sources and file (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeurer committed Feb 18, 2023
1 parent 6032003 commit d4e9c31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Bundle.js
Expand Up @@ -144,7 +144,7 @@ export default class Bundle {
});

return {
file: options.file ? options.file.split(/[/\\]/).pop() : null,
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
sources: this.uniqueSources.map((source) => {
return options.file ? getRelativePath(options.file, source.filename) : source.filename;
}),
Expand Down
6 changes: 3 additions & 3 deletions src/MagicString.js
Expand Up @@ -163,9 +163,9 @@ export default class MagicString {
});

return {
file: options.file ? options.file.split(/[/\\]/).pop() : null,
sources: [options.source ? getRelativePath(options.file || '', options.source) : null],
sourcesContent: options.includeContent ? [this.original] : [null],
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
sources: [options.source ? getRelativePath(options.file || '', options.source) : (options.file || '')],
sourcesContent: options.includeContent ? [this.original] : undefined,
names,
mappings: mappings.raw,
};
Expand Down

0 comments on commit d4e9c31

Please sign in to comment.