mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: keep license comment in minified umd (#5196)
* The `preserveComments` option from the old uglify gulp plugin is not valid for the programmatic API. Setting the `comments` option `some` means that license commens will be preserved.
This commit is contained in:
committed by
Jeremy Elbourn
parent
135c1df62e
commit
b456eed0b7
@@ -7,8 +7,10 @@ const uglify = require('uglify-js');
|
||||
export function uglifyJsFile(inputPath: string, outputPath: string) {
|
||||
const sourcemapOut = `${outputPath}.map`;
|
||||
const result = uglify.minify(inputPath, {
|
||||
preserveComments: 'license',
|
||||
outSourceMap: sourcemapOut
|
||||
outSourceMap: sourcemapOut,
|
||||
output: {
|
||||
comments: 'some'
|
||||
}
|
||||
});
|
||||
|
||||
writeFileSync(outputPath, result.code);
|
||||
|
||||
Reference in New Issue
Block a user