diff --git a/build/Gruntfile.js b/build/Gruntfile.js index 3df6b23d0..2d6b3dbde 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -555,6 +555,7 @@ module.exports = function(grunt) { webpack_app_build: { options: { cwd: '../vendor/framework7-react', + env: {...process.env, ...{addon: grunt.option('addon')}}, }, cmd: function() { const editor = packageFile.name == 'presentationeditor' ? 'slide' : diff --git a/vendor/framework7-react/build/webpack.config.js b/vendor/framework7-react/build/webpack.config.js index 528bba64b..ed95b3cbb 100644 --- a/vendor/framework7-react/build/webpack.config.js +++ b/vendor/framework7-react/build/webpack.config.js @@ -231,8 +231,9 @@ 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 => (env == 'development' || /web-apps-mobile/.test(process.env.addon)) && + 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 ),