Skip to content

Commit

Permalink
chore: fixes for vite dev server (#2678)
Browse files Browse the repository at this point in the history
  • Loading branch information
kloon15 committed Aug 29, 2023
1 parent a404fb0 commit aa00c1c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions frontend/.prettierignore
@@ -0,0 +1,2 @@
# Ignore artifacts:
dist
27 changes: 26 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Expand Up @@ -53,7 +53,8 @@
"prettier": "^3.0.1",
"terser": "^5.19.2",
"vite": "^4.4.9",
"vite-plugin-compression2": "^0.10.3"
"vite-plugin-compression2": "^0.10.3",
"vite-plugin-rewrite-all": "^1.0.1"
},
"browserslist": [
"> 1%",
Expand Down
6 changes: 6 additions & 0 deletions frontend/vite.config.js
Expand Up @@ -4,6 +4,7 @@ import { defineConfig } from "vite";
import legacy from "@vitejs/plugin-legacy";
import vue2 from "@vitejs/plugin-vue2";
import { compression } from "vite-plugin-compression2";
import pluginRewriteAll from "vite-plugin-rewrite-all";

const plugins = [
vue2(),
Expand All @@ -12,6 +13,7 @@ const plugins = [
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
}),
compression({ include: /\.js$/i, deleteOriginalAssets: true }),
pluginRewriteAll(), // fixes 404 error with paths containing dot in dev server
];

const resolve = {
Expand All @@ -29,6 +31,10 @@ export default defineConfig(({ command }) => {
resolve,
server: {
proxy: {
"/api/command": {
target: "ws://127.0.0.1:8080",
ws: true,
},
"/api": "http://127.0.0.1:8080",
},
},
Expand Down

0 comments on commit aa00c1c

Please sign in to comment.