Skip to content

Commit

Permalink
SEBSP-155
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadim Ritter committed Aug 26, 2024
1 parent b6cfe99 commit 27ec572
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 66 deletions.
131 changes: 67 additions & 64 deletions client/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,70 @@ import { gitTagPlugin } from "./src/plugins/vite-plugin-git-tag";
import fs from "fs/promises";

// Utilities
import { defineConfig } from "vite"
import { fileURLToPath, URL } from "node:url"


export default defineConfig({
plugins: [

vue({
template: { transformAssetUrls }
}),

vuetify({
autoImport: true,
}),

VueI18nPlugin({
include: fileURLToPath(new URL("./src/i18n/locales/**", import.meta.url)),
}),

{
name: 'index-html-env',
async transformIndexHtml() {
if (process.env.NODE_ENV !== 'production') {
return await fs.readFile('index.dev.html', 'utf8')
}
}
},

// gitTagPlugin()
],

base: process.env.VITE_BASE_PATH,

build: {
chunkSizeWarningLimit: 2000
},

define: {
"process.env": {},
_global: ({})
},

resolve: {

alias: {
"@": fileURLToPath(new URL("./src", import.meta.url))
},

extensions: [
".js",
".json",
".jsx",
".mjs",
".ts",
".tsx",
".vue",
],
},

server: {
port: 8081,
},

})
import { defineConfig, loadEnv } from "vite";
import { fileURLToPath, URL } from "node:url";


export default ({ mode }) => {
process.env = {...process.env, ...loadEnv(mode, process.cwd())};
return defineConfig({
plugins: [

vue({
template: { transformAssetUrls }
}),

vuetify({
autoImport: true,
}),

VueI18nPlugin({
include: fileURLToPath(new URL("./src/i18n/locales/**", import.meta.url)),
}),

{
name: 'index-html-env',
async transformIndexHtml() {
if (process.env.NODE_ENV !== 'production') {
return await fs.readFile('index.dev.html', 'utf8')
}
}
},

// gitTagPlugin()
],

base: process.env.VITE_BASE_PATH,

build: {
chunkSizeWarningLimit: 2000
},

define: {
"process.env": {},
_global: ({})
},

resolve: {

alias: {
"@": fileURLToPath(new URL("./src", import.meta.url))
},

extensions: [
".js",
".json",
".jsx",
".mjs",
".ts",
".tsx",
".vue",
],
},

server: {
port: 8081,
},

});
}
4 changes: 2 additions & 2 deletions server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if(ENV.NODE_ENV === "dev"){


//static files config
app.use(ENV.BASE_PATH, express.static(path));
app.use(express.static(path));
app.use(bodyParser.json());


Expand All @@ -46,7 +46,7 @@ app.get("/", (req: Request, res: Response) => {

});

app.get(ENV.BASE_PATH + "/*", (req: Request, res: Response) => {
app.get("*", (req: Request, res: Response) => {
res.sendFile(mainIndexPath);
});

Expand Down

0 comments on commit 27ec572

Please sign in to comment.