Merge pull request #1036 from ONLYOFFICE/feature/skip-addon-path

[mobile] skip addon path from deploy script
This commit is contained in:
maxkadushkin 2021-08-02 11:00:09 +03:00 committed by GitHub
commit 5a7c45583d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View file

@ -517,6 +517,7 @@ module.exports = function(grunt) {
// }
// },
exec: {
webpack_app_build: {
options: {
@ -525,7 +526,10 @@ module.exports = function(grunt) {
cmd: function() {
const editor = packageFile.name == 'presentationeditor' ? 'slide' :
packageFile.name == 'spreadsheeteditor' ? 'cell' : 'word';
return `npm run deploy-${editor}`;
// return `npm run deploy-${editor}`;
const addon_path = `${packageFile.mobile.js.reactjs && !!packageFile.mobile.js.reactjs.features ? `ADDON_ENV=${packageFile.mobile.js.reactjs.features}` : ''}`;
return `npx cross-env TARGET_EDITOR=${editor} NODE_ENV=production ${addon_path} node ./build/build.js`;
},
},
webpack_install: {

View file

@ -20,6 +20,7 @@ const target = process.env.TARGET || 'web';
const editor = process.env.TARGET_EDITOR == 'cell' ? 'spreadsheeteditor' :
process.env.TARGET_EDITOR == 'slide' ? 'presentationeditor' : 'documenteditor';
const targetPatch = process.env.TARGET_EDITOR || 'word';
const addonPath = process.env.ADDON_ENV || '';
module.exports = {
mode: env,
@ -77,9 +78,10 @@ module.exports = {
resolvePath('node_modules/dom7'),
resolvePath('node_modules/ssr-window'),
resolvePath('../../../web-apps-mobile/word'),
resolvePath('../../../web-apps-mobile/slide'),
resolvePath('../../../web-apps-mobile/cell')
resolvePath(`${addonPath}`),
//resolvePath('../../../web-apps-mobile/word'),
//resolvePath('../../../web-apps-mobile/slide'),
//resolvePath('../../../web-apps-mobile/cell')
],
},
@ -218,8 +220,10 @@ module.exports = {
}),
new webpack.NormalModuleReplacementPlugin(
/\.{2}\/lib\/patch/,
resource => fs.existsSync(`../../../web-apps-mobile/${targetPatch}/patch.jsx`) ?
resource.request = `../../../../../../web-apps-mobile/${targetPatch}/patch.jsx` : resource
//resource => fs.existsSync(`../../../web-apps-mobile/${targetPatch}/patch.jsx`) ?
// resource.request = `../../../../../../web-apps-mobile/${targetPatch}/patch.jsx` : resource
resource => fs.existsSync(`${addonPath}/patch.jsx`) ?
resource.request = `../../../${addonPath}/patch.jsx` : resource
),
],
};