Skip to content

Commit b456eed

Browse files
devversionjelbourn
authored andcommitted
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.
1 parent 135c1df commit b456eed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/package-tools/minify-sources.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ const uglify = require('uglify-js');
77
export function uglifyJsFile(inputPath: string, outputPath: string) {
88
const sourcemapOut = `${outputPath}.map`;
99
const result = uglify.minify(inputPath, {
10-
preserveComments: 'license',
11-
outSourceMap: sourcemapOut
10+
outSourceMap: sourcemapOut,
11+
output: {
12+
comments: 'some'
13+
}
1214
});
1315

1416
writeFileSync(outputPath, result.code);

0 commit comments

Comments
 (0)