Skip to content

Commit

Permalink
feat: show filename for minify warnings (ng-packagr#882)
Browse files Browse the repository at this point in the history
This should help the normal user to identify the bundled source file which originated the warnings.
There is also mishoo/UglifyJS#516 which tracks using the source-maps to
display the correct originating file of the warning.
  • Loading branch information
pfeigl committed May 20, 2018
1 parent 57f5ed9 commit 5f8b719
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/lib/flatten/uglify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,24 @@ export async function minifyJsFile(inputPath: string, outputPath?: string): Prom
readFile(`${inputPath}.map`)
]);

const result = minify(inputFileBuffer.toString(), {
sourceMap: {
includeSources: true,
content: JSON.parse(inputSourceMapBuffer.toString()),
url: basename(sourcemapOut)
},
parse: {
bare_returns: true
},
ie8: true,
warnings: true,
output: {
comments: 'some'
const result = minify(
{ [inputPath]: inputFileBuffer.toString() },
{
sourceMap: {
includeSources: true,
content: JSON.parse(inputSourceMapBuffer.toString()),
url: basename(sourcemapOut)
},
parse: {
bare_returns: true
},
ie8: true,
warnings: true,
output: {
comments: 'some'
}
}
});
);

if (result.warnings) {
for (const warningMessage of result.warnings) {
Expand Down

0 comments on commit 5f8b719

Please sign in to comment.