Skip to content

Commit

Permalink
fix(plugin): don't merge the entire user vite.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mkilpatrick committed Sep 17, 2024
1 parent 1b9de9e commit 4291e3b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/pages/src/vite-plugin/serverless-functions/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { processEnvVariables } from "../../util/processEnvVariables.js";
import { FunctionMetadataParser } from "../../common/src/function/internal/functionMetadataParser.js";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import pc from "picocolors";
import {
removePluginFromViteConfig,
scopedViteConfigPath,
} from "../../util/viteConfig.js";
import { scopedViteConfigPath } from "../../util/viteConfig.js";

export const buildServerlessFunctions = async (
projectStructure: ProjectStructure
Expand Down Expand Up @@ -98,7 +95,13 @@ export const buildServerlessFunctions = async (
};
await build(
mergeConfig(
removePluginFromViteConfig(viteConfig.default),
{
build: {
rollupOptions: {
external: viteConfig.default.build.rollupOptions.external,
},
},
},
serverlessFunctionBuildConfig
)
);
Expand Down

0 comments on commit 4291e3b

Please sign in to comment.