Skip to content

Commit

Permalink
deployment issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-dixit committed Jun 26, 2024
1 parent 4ab8a94 commit 22dc810
Show file tree
Hide file tree
Showing 5 changed files with 5,371 additions and 7,863 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ VITE_APP_VERSION = v3.0.0
GENERATE_SOURCEMAP = false

PUBLIC_URL = https://codedthemes.com/demos/admin-templates/materially/react/free
VIITE_APP_BASE_NAME = /demos/admin-templates/materially/react/free
VITE_APP_BASE_NAME = demos/admin-templates/materially/react/free
4 changes: 0 additions & 4 deletions .env.development

This file was deleted.

2 changes: 1 addition & 1 deletion .env.qa
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REACT_APP_VERSION = v3.0.0
GENERATE_SOURCEMAP = false
PUBLIC_URL = https://codedthemes.com/demos/admin-templates/materially/react/free/stage
REACT_APP_BASE_NAME = demos/admin-templates/materially/react/free/stage
VITE_APP_BASE_NAME = demos/admin-templates/materially/react/free/stage
70 changes: 35 additions & 35 deletions vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
// https://github.com/vitejs/vite/discussions/3448
import path from 'path';
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import jsconfigPaths from 'vite-jsconfig-paths';

// ----------------------------------------------------------------------
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const API_URL = `${env.VITE_APP_BASE_NAME}`;
// this sets a default port to 3000
const PORT = `${'3000'}`;

export default defineConfig({
plugins: [react(), jsconfigPaths()],
// https://github.com/jpuri/react-draft-wysiwyg/issues/1317
base: process.env.VITE_APP_BASE_NAME,
define: {
global: 'window'
},
resolve: {
alias: [
{
find: /^~(.+)/,
replacement: path.join(process.cwd(), 'node_modules/$1')
},
{
find: /^src(.+)/,
replacement: path.join(process.cwd(), 'src/$1')
}
]
},
server: {
// this ensures that the browser opens upon server start
open: true,
// this sets a default port to 3000
port: 3000
},
preview: {
// this ensures that the browser opens upon preview start
open: true,
// this sets a default port to 3000
port: 3000
}
return {
server: {
// this ensures that the browser opens upon server start
open: true,
port: PORT
},
define: {
global: 'window'
},
resolve: {
// alias: [
// {
// find: /^~(.+)/,
// replacement: path.join(process.cwd(), 'node_modules/$1')
// },
// {
// find: /^src(.+)/,
// replacement: path.join(process.cwd(), 'src/$1')
// }
// ]
},
preview: {
// this ensures that the browser opens upon preview start
open: true,
port: PORT
},
base: API_URL,
plugins: [react(), jsconfigPaths()]
};
});
Loading

0 comments on commit 22dc810

Please sign in to comment.