Skip to content

Commit

Permalink
fix: 配置文件公共路径无效 (#3007)
Browse files Browse the repository at this point in the history
  • Loading branch information
k1ngbanana committed Sep 8, 2023
1 parent aaf2fde commit a244dcd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/vite-config/src/config/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) {
return defineConfig(async ({ command, mode }) => {
const root = process.cwd();
const isBuild = command === 'build';
const { VITE_USE_MOCK, VITE_BUILD_COMPRESS, VITE_ENABLE_ANALYZE } = loadEnv(mode, root);
const { VITE_PUBLIC_PATH, VITE_USE_MOCK, VITE_BUILD_COMPRESS, VITE_ENABLE_ANALYZE } = loadEnv(
mode,
root,
);

const defineData = await createDefineData(root);
const plugins = await createPlugins({
Expand All @@ -35,6 +38,7 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) {
const pathResolve = (pathname: string) => resolve(root, '.', pathname);

const applicationConfig: UserConfig = {
base: VITE_PUBLIC_PATH,
resolve: {
alias: [
{
Expand Down

0 comments on commit a244dcd

Please sign in to comment.