Skip to content

Commit 3784702

Browse files
committed
Sync with Kendo UI Professional
1 parent 4bfef4f commit 3784702

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

gulpfile.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ function renameModules(match) {
5959
const terserOptions = {
6060
mangle: {
6161
reserved: [ "define", "KendoLicensing" ]
62+
},
63+
format: {
64+
comments: (node, comments) => comments.value.includes("Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.") // Preserve license comment.
6265
}
6366
};
6467

@@ -73,24 +76,28 @@ function uglifyScripts(stream) {
7376
}
7477

7578
function minScripts() {
76-
return gulp.src(['dist/js/kendo.*.js', 'dist/js/cultures/*.js', 'dist/js/messages/*.js'], { base: "dist/js" })
79+
return gulp.src(['dist/raw-js/kendo.*.js', 'dist/raw-js/cultures/*.js', 'dist/raw-js/messages/*.js'], { base: "dist/raw-js" })
80+
.pipe(gulp.dest('dist/js')) // copy the unminified files alongside the minified ones.
7781
.pipe(filter(file => !/\.min\.js/.test(file.path)))
7882
.pipe(flatmap(uglifyScripts))
7983
.pipe(gulp.dest('dist/js'));
8084
}
8185

8286
function mjsMin() {
83-
return gulp.src(['dist/mjs/kendo.*.js', 'dist/mjs/cultures/*.js', 'dist/mjs/messages/*.js'], { base: "dist/mjs" })
87+
return gulp.src(['dist/raw-mjs/kendo.*.js', 'dist/raw-mjs/cultures/*.js', 'dist/raw-mjs/messages/*.js'], { base: "dist/raw-mjs" })
8488
.pipe(gulpIf(makeSourceMaps, sourcemaps.init()))
8589
.pipe(terser(terserOptions))
8690
.pipe(sourcemaps.write("./"))
8791
.pipe(gulp.dest('dist/mjs'));
8892
}
8993

9094
gulp.task('js-license', function() {
91-
return gulp.src(['dist/js/**/kendo.*.js', 'dist/mjs/**/kendo.*.js'], { base: './dist' })
95+
return gulp.src(['dist/raw-js/**/kendo.*.js', 'dist/raw-mjs/**/kendo.*.js'], { base: './dist' })
9296
.pipe(flatmap(license))
93-
.pipe(gulp.dest('dist/temp'));
97+
.pipe(gulp.dest((file) => {
98+
file.dirname = file.dirname.replace('raw-', '');
99+
return 'dist/temp';
100+
}));
94101
});
95102

96103
gulp.task("scripts", gulp.series(gulp.parallel(compileMjsScripts,

rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const resourcesConfig = (name, options = {}) => ({
6464
input: `${root}/${name}`,
6565
output: [{
6666
format: "umd",
67-
dir: `./dist/js/${options.dir}`,
67+
dir: `./dist/raw-js/${options.dir}`,
6868
sourcemap: false,
6969
...baseOptions
7070
}],
@@ -84,7 +84,7 @@ const configMap = (name) => ({
8484
input: `${root}/${name}`,
8585
output: [{
8686
format: 'umd',
87-
dir: './dist/js',
87+
dir: './dist/raw-js',
8888
sourcemap: false,
8989
name: name.replace('.', ''),
9090
...baseOptions

rollup.mjs.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import polyfill from 'rollup-plugin-polyfill';
99
input: `${root}/${name}`,
1010
output: [{
1111
format: "esm",
12-
dir: `./dist/mjs/${options.dir}`,
12+
dir: `./dist/raw-mjs/${options.dir}`,
1313
sourcemap: false,
1414
plugins: [
1515
addKendoVersion()
@@ -31,7 +31,7 @@ const configMap = (name) => ({
3131
input: `${root}/${name}`,
3232
output: [{
3333
format: 'esm',
34-
dir: './dist/mjs',
34+
dir: './dist/raw-mjs',
3535
sourcemap: false,
3636
plugins: [
3737
addKendoVersion()

0 commit comments

Comments
 (0)