Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Nov 11, 2024
1 parent 5039cb2 commit 3585559
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@
"tsc": "tsc && tsc -p frontend/tsconfig.json",
"test": "exit 0",
"build": "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js --format=cjs --sourcemap=inline",
"build:frontend": "cd frontend && yarn build",
"build:frontend": "(cd frontend && yarn build) && rm -rf dist/frontend && mkdir -p dist && mv frontend/dist dist/frontend",
"watch": "yarn build --watch",
"prepack": "npm run build",
"prepack": "yarn build",
"dev": "yarn build && concurrently -k \"cd frontend && yarn dev\" \"yarn watch\" \"node --enable-source-maps --watch . --dev-mode\""
},
"files": [
"/frontend/dist/**",
"/dist/**"
],
"pkg": {
"assets": [
"frontend/dist/**"
"dist/**"
]
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ export default ({ sharedPath: sharedPathIn, port, maxUploadSize, zipCompressionL

// Serving the frontend depending on dev/production
if (devMode) app.use('/', createProxyMiddleware({ target: 'http://localhost:3000', ws: true }));
else app.use('/', express.static(join(__dirname, '../frontend/dist')));
else app.use('/', express.static(join(__dirname, 'frontend')));

// Default to index because SPA
app.use('*', (_req, res) => res.sendFile(join(__dirname, '../frontend/dist/index.html')));
app.use('*', (_req, res) => res.sendFile(join(__dirname, 'frontend/index.html')));
};

0 comments on commit 3585559

Please sign in to comment.