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:
Paul Gschwendtner
2017-06-19 18:30:37 +02:00
committed by Jeremy Elbourn
parent 135c1df62e
commit b456eed0b7
+4 -2
View File
@@ -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);