diff --git a/src/Bundle.js b/src/Bundle.js index e682fb5..04d6f20 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -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; }), diff --git a/src/MagicString.js b/src/MagicString.js index ea85160..f8bfad0 100644 --- a/src/MagicString.js +++ b/src/MagicString.js @@ -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, };