Skip to content

Commit

Permalink
test: respect commonjs options in playgrounds (#13273)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev authored May 22, 2023
1 parent 8013a66 commit 19e8c68
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,12 @@ export async function resolveConfig(
const userPlugins = [...prePlugins, ...normalPlugins, ...postPlugins]
config = await runConfigHook(config, userPlugins, configEnv)

if (process.env.VITE_TEST_WITHOUT_PLUGIN_COMMONJS) {
// If there are custom commonjsOptions, don't force optimized deps for this test
// even if the env var is set as it would interfere with the playground specs.
if (
!config.build?.commonjsOptions &&
process.env.VITE_TEST_WITHOUT_PLUGIN_COMMONJS
) {
config = mergeConfig(config, {
optimizeDeps: { disabled: false },
ssr: { optimizeDeps: { disabled: false } },
Expand Down

0 comments on commit 19e8c68

Please sign in to comment.