Skip to content

Commit

Permalink
chore: Make EE plugin on frontend > link instead of copy
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCizmar committed Nov 28, 2024
1 parent b924d38 commit 589ff98
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webapp/scripts/prepareEE.cjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
// 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');
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);
}

0 comments on commit 589ff98

Please sign in to comment.