Skip to content

Commit

Permalink
feat: added util script to remove export {}; from frontend JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Moore committed Jul 13, 2023
1 parent 466fc5e commit 26c6841
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions common/fix-frontend-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fs = require('fs-extra');
const { path } = require('@tycrek/joint');
const log = new (require('@tycrek/log').TLog)();

log.info('Fixing frontend JS');

// Read & fix file data
const setupUiFile = path.join('dist-frontend/setup.mjs');
const setupUiNew = fs.readFileSync(setupUiFile).toString().replace('export {};', '');

// Write new file
fs.writeFileSync(setupUiFile, setupUiNew);

log.success('Fixed.');
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"build": "rm -dr dist-*/ & npm run build:backend && npm run build:frontend",
"build:backend": "tsc -p backend/",
"build:frontend": "tsc -p frontend/",
"postbuild:frontend": "node common/fix-frontend-js.js",
"start": "node dist-backend/app.js",
"cli-setpassword": "node dist/tools/script.setpassword.js",
"cli-testpassword": "node dist/tools/script.testpassword.js",
Expand Down

0 comments on commit 26c6841

Please sign in to comment.