From 7ac7fea80354a4ee1fb5e18a6da29850262dd53e Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 26 Jun 2022 18:24:18 +0300 Subject: [PATCH] espo bundled --- Gruntfile.js | 15 +++++++++------ js/diff.js | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 58f83c2c0f..a2169838cb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -40,7 +40,9 @@ module.exports = grunt => { const bundleConfig = require('./frontend/bundle-config.json'); const libs = require('./frontend/libs.json'); - let bundleJsFileList = buildUtils.getBundleLibList(libs).concat('build/tmp/espo-bundle.js'); + const bundledDir = 'client/lib/bundled'; + + let bundleJsFileList = buildUtils.getBundleLibList(libs).concat(bundledDir + '/espo.js'); let copyJsFileList = buildUtils.getCopyLibDataList(libs); let minifyLibFileList = copyJsFileList @@ -116,7 +118,6 @@ module.exports = grunt => { '!build/tmp/client/custom/modules', 'build/tmp/client/custom/modules/*', '!build/tmp/client/custom/modules/dummy.txt', - 'build/tmp/espo-bundle.js', ] }, }, @@ -253,15 +254,17 @@ module.exports = grunt => { let contents = (new Bundler()).bundle(bundleConfig.jsFiles); - fs.writeFileSync('build/tmp/espo-bundle.js', contents, 'utf8'); + if (!fs.existsSync(bundledDir)){ + fs.mkdirSync(bundledDir); + } + + fs.writeFileSync(bundledDir + '/espo.js', contents, 'utf8'); }); grunt.registerTask('chmod-folders', () => { cp.execSync( "find . -type d -exec chmod 755 {} +", - { - cwd: 'build/EspoCRM-' + pkg.version, - } + {cwd: 'build/EspoCRM-' + pkg.version} ); }); diff --git a/js/diff.js b/js/diff.js index cc6800a4a4..392c27c332 100644 --- a/js/diff.js +++ b/js/diff.js @@ -260,6 +260,7 @@ class Diff fileList.push('client/lib/espo.min.js'); fileList.push('client/lib/espo.min.js.map'); + fileList.push('client/lib/bundled/espo.js'); fs.readdirSync('client/css/espo/').forEach(file => { fileList.push('client/css/espo/' + file);