-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
5,371 additions
and
7,863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()] | ||
}; | ||
}); |
Oops, something went wrong.