@data-fair/dev-server 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/src/app.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/dev-server",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "A development server for optimal development experience of data-fair applications.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -9,6 +9,7 @@
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "build": "tsc",
12
+ "build-watch": "tsc --watch",
12
13
  "dev": "NODE_ENV=development node --watch src/index.js",
13
14
  "dev-test-app-minimal": "http-server test-apps/minimal --port=3000 --cors --silent",
14
15
  "dev-test-app-vue3": "cd test-apps/vue3 && npm run dev",
package/src/app.js CHANGED
@@ -75,7 +75,7 @@ app.post('/config/error', (req, res) => {
75
75
  });
76
76
  // re-expose the application performing similar modifications to the body as data-fair
77
77
  const appUrl = new URL(config.app.url);
78
- const appPrefix = appUrl.pathname === '/' ? '' : appUrl.pathname;
78
+ const appPrefix = appUrl.pathname.endsWith('/') ? appUrl.pathname.substring(0, appUrl.pathname.length - 1) : appUrl.pathname;
79
79
  app.use('/app', createProxyMiddleware({
80
80
  target: appUrl.origin,
81
81
  secure: false,
@@ -247,7 +247,7 @@ app.use('/simple-directory', createProxyMiddleware({
247
247
  }
248
248
  }));
249
249
  if (config.serveUi) {
250
- app.use(await createSpaMiddleware(resolve(import.meta.dirname, '../ui/dist'), uiConfig));
250
+ app.use(await createSpaMiddleware(resolve(import.meta.dirname, '../ui/dist'), uiConfig, { ignoreSitePath: true }));
251
251
  }
252
252
  else {
253
253
  app.use('/', createProxyMiddleware({