-
Notifications
You must be signed in to change notification settings - Fork 36
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
10 changed files
with
65 additions
and
151 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
Binary file not shown.
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 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 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 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,60 +1,65 @@ | ||
import { defineConfig } from 'vite'; | ||
import { defineConfig, loadEnv } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
import jsconfigPaths from 'vite-jsconfig-paths'; | ||
|
||
export default defineConfig({ | ||
// depending on your application, base can also be "/" | ||
base: process.env.VITE_APP_BASE_NAME, | ||
plugins: [react(), jsconfigPaths()], | ||
define: { | ||
global: 'window' | ||
}, | ||
resolve: { | ||
alias: [ | ||
// { find: '', replacement: path.resolve(__dirname, 'src') }, | ||
// { | ||
// find: /^~(.+)/, | ||
// replacement: path.join(process.cwd(), 'node_modules/$1') | ||
// }, | ||
// { | ||
// find: /^src(.+)/, | ||
// replacement: path.join(process.cwd(), 'src/$1') | ||
// } | ||
// { | ||
// find: 'assets', | ||
// replacement: path.join(process.cwd(), 'src/assets') | ||
// }, | ||
] | ||
}, | ||
server: { | ||
// this ensures that the browser opens upon server start | ||
open: true, | ||
// this sets a default port to 3000 | ||
port: 3000 | ||
}, | ||
css: { | ||
preprocessorOptions: { | ||
scss: { | ||
charset: false | ||
}, | ||
less: { | ||
charset: false | ||
} | ||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd(), ''); | ||
const API_URL = `${env.VITE_APP_BASE_NAME}`; | ||
const PORT = `${'3000'}`; | ||
|
||
return { | ||
server: { | ||
// this ensures that the browser opens upon server start | ||
open: true, | ||
// this sets a default port to 3000 | ||
port: PORT | ||
}, | ||
define: { | ||
global: 'window' | ||
}, | ||
resolve: { | ||
alias: [ | ||
// { find: '', replacement: path.resolve(__dirname, 'src') }, | ||
// { | ||
// find: /^~(.+)/, | ||
// replacement: path.join(process.cwd(), 'node_modules/$1') | ||
// }, | ||
// { | ||
// find: /^src(.+)/, | ||
// replacement: path.join(process.cwd(), 'src/$1') | ||
// } | ||
// { | ||
// find: 'assets', | ||
// replacement: path.join(process.cwd(), 'src/assets') | ||
// }, | ||
] | ||
}, | ||
charset: false, | ||
postcss: { | ||
plugins: [ | ||
{ | ||
postcssPlugin: 'internal:charset-removal', | ||
AtRule: { | ||
charset: (atRule) => { | ||
if (atRule.name === 'charset') { | ||
atRule.remove(); | ||
css: { | ||
preprocessorOptions: { | ||
scss: { | ||
charset: false | ||
}, | ||
less: { | ||
charset: false | ||
} | ||
}, | ||
charset: false, | ||
postcss: { | ||
plugins: [ | ||
{ | ||
postcssPlugin: 'internal:charset-removal', | ||
AtRule: { | ||
charset: (atRule) => { | ||
if (atRule.name === 'charset') { | ||
atRule.remove(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}); | ||
] | ||
} | ||
}, | ||
base: API_URL, | ||
plugins: [react(), jsconfigPaths()] | ||
}; | ||
}); |
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