mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Maintain Copyright statements in minified code
This commit is contained in:
parent
f7877a7b22
commit
d4c12fde31
1 changed files with 15 additions and 1 deletions
16
gulpfile.js
16
gulpfile.js
|
|
@ -96,7 +96,21 @@ gulp.task('release', ['clean-release','compile'], function() {
|
|||
}))
|
||||
.pipe(gulp.dest('./release/dev'))
|
||||
.pipe(uglify({
|
||||
preserveComments: 'some'
|
||||
preserveComments: function(node, token) {
|
||||
var text = token.value;
|
||||
if (text.indexOf('monaco-html version') >= 0) {
|
||||
// this is the main copyright header
|
||||
return true;
|
||||
}
|
||||
if (text.indexOf('Copyright (c) Microsoft') >= 0) {
|
||||
// this is another Microsoft copyright header (not the main)
|
||||
return false;
|
||||
}
|
||||
if (/copyright/i.test(text)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('./release/min')),
|
||||
gulp.src('src/monaco.d.ts').pipe(gulp.dest('./release/min'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue