diff --git a/webapp/scripts/prepareEE.cjs b/webapp/scripts/prepareEE.cjs index ade7323eb9..a0aca9e6e8 100644 --- a/webapp/scripts/prepareEE.cjs +++ b/webapp/scripts/prepareEE.cjs @@ -1,7 +1,7 @@ // if src/ee exists copy the webapp/src/eePlugin.ee.tsx to webapp/src/eePlugin.local.tsx // else copy the webapp/src/eePlugin.oss.tsx to webapp/src/eePlugin.local.tsx -const { existsSync, copyFileSync } = require('fs'); +const { existsSync, symlinkSync, unlinkSync } = require('fs'); const { join } = require('path'); const srcDir = join(__dirname, '../src/ee'); @@ -9,8 +9,12 @@ const eePluginEe = join(__dirname, '../src/eePlugin.ee.tsx'); const eePluginOss = join(__dirname, '../src/eePlugin.oss.tsx'); const eePluginLocal = join(__dirname, '../src/eePlugin.local.tsx'); +if (existsSync(eePluginLocal)) { + unlinkSync(eePluginLocal); +} + if (existsSync(srcDir)) { - copyFileSync(eePluginEe, eePluginLocal); + symlinkSync(eePluginEe, eePluginLocal); } else { - copyFileSync(eePluginOss, eePluginLocal); + symlinkSync(eePluginOss, eePluginLocal); }