[main] added Babel transpiler for IE

This commit is contained in:
maxkadushkin
2024-08-07 20:14:23 +03:00
parent 09d3899c57
commit 6063b95e73
6 changed files with 1827 additions and 258 deletions

View File

@ -149,6 +149,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-svgmin');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-terser');
grunt.loadNpmTasks('grunt-babel');
function doRegisterTask(name, callbackConfig) {
return grunt.registerTask(name + '-init', function() {
@ -452,9 +453,9 @@ module.exports = function(grunt) {
localization: {
files: packageFile['main']['copy']['localization']
},
help: {
files: packageFile['main']['copy']['help']
},
// help: {
// files: packageFile['main']['copy']['help']
// },
indexhtml: {
files: packageFile['main']['copy']['indexhtml']
}
@ -508,6 +509,27 @@ module.exports = function(grunt) {
src: packageFile.main.js.postload.options.out,
dest: packageFile.main.js.postload.options.out,
},
iecompat: {
options: {
sourceMap: false,
},
files: [{
expand: true,
cwd: packageFile.main.js.babel.files[0].dest,
src: `*.js`,
dest: packageFile.main.js.babel.files[0].dest
}]
},
},
babel: {
options: {
sourceMap: false,
presets: ['@babel/preset-env']
},
dist: {
files: packageFile.main.js.babel.files
}
},
});
@ -797,7 +819,7 @@ module.exports = function(grunt) {
grunt.registerTask('deploy-common-embed', ['common-embed-init', 'clean', 'copy']);
grunt.registerTask('deploy-app-main', ['prebuild-icons-sprite', 'main-app-init', 'clean:prebuild', 'imagemin', 'less',
'requirejs', 'terser', 'concat', 'copy', 'svgmin', 'inline', 'json-minify',
'requirejs', 'babel', 'terser', 'concat', 'copy', 'svgmin', 'inline', 'json-minify',
'replace:writeVersion', 'replace:prepareHelp', 'clean:postbuild']);
grunt.registerTask('deploy-app-mobile', ['mobile-app-init', 'clean:deploy', /*'cssmin',*/ /*'copy:template-backup',*/

View File

@ -106,6 +106,16 @@
"text": "../vendor/requirejs-text/text"
}
}
},
"babel": {
"files": [
{
"expand": true,
"cwd": "../deploy/web-apps/apps/documenteditor/main/",
"src": "*.js",
"dest": "../deploy/web-apps/apps/documenteditor/main/ie"
}
]
}
},
"less": {

2035
build/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,10 @@
"homepage": "http://www.onlyoffice.com",
"private": true,
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"grunt": "^1.6.1",
"grunt-babel": "^8.0.0",
"grunt-contrib-clean": "^2.0.1",
"grunt-contrib-concat": "^2.0.0",
"grunt-contrib-copy": "^1.0.0",