import { defineConfig, mergeConfig } from 'vite'; // Does not work when using a function parameter const config = defineConfig(() => ({ plugins: [], })); mergeConfig( config, defineConfig({ envPrefix: 'PUBLIC_', }), ); // Works when not using a function parameter const config...
In the vite.config.js file, if thedefineConfigmethod takes in a function and returns a config, it will cause unit tests to fail. However, if an object is passed in, the tests will run normally.#13229 Closed patak-devmerged commit998512bintovitejs:mainJun 6, 2023 ...
{ const defaultEntry = lookupFile({ dir: path.resolve(rootDir, fnsInDir), formats: ['js', 'ts', 'mjs'].map((ext) => 'index.' + ext), pathOnly: true, bubble: false, }) entry = defaultEntry || false } if (entry) { const wranglerConfig = await getWranglerConfig(viteConfig) ...
createViteConfig = async (context: BuildContext, input: ViteOptions): Promise<UserConfig> => { if (context.entries.length !== 1) { logger.error('Currently vite driver only supports one application entry.'); process.exit(24); } // 兼容一下`publicPath`有没有最后的`/`的情况 const ...
packages/vite/src/node/utils.ts Original file line numberDiff line numberDiff line change @@ -1110,6 +1110,9 @@ function mergeConfigRecursively( ...backwardCompatibleWorkerPlugins(value), ] continue } else if (key === 'server' && rootPath === 'server.hmr') { merged[key] = value ...
Deeply merge two Vite configs. `isRoot` represents the level within the Vite config which is being merged. For example, set `false` if you're merging two `build` options. ::: tip NOTE `mergeConfig` accepts only config in object form. If you have a config in callback form, you shoul...
vite.config.base.ts Original file line numberDiff line numberDiff line change @@ -1,14 +1,12 @@ import{fileURLToPath,URL}from'node:url' import{defineConfig}from'vite' import{typeUserConfig}from'vite' importvuefrom'@vitejs/plugin-vue' ...
View details patak-dev merged commit 3104331 into vitejs:main Dec 2, 2024 15 checks passed hi-ogawa deleted the fix-merge-root-ssr-resvole-with-environment branch December 2, 2024 23:01 renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Dec...
16 changes: 16 additions & 0 deletions 16 packages/vite/src/node/__tests__/config.spec.ts Original file line numberDiff line numberDiff line change @@ -141,6 +141,22 @@ describe('mergeConfig', () => { expect(mergeConfig(baseConfig, newConfig)).toEqual(mergedConfig) }) test('merge...
vite: config.vite ?? {}, manifest, imports: config.imports ?? {}, runnerConfig: await loadConfig<ExtensionRunnerConfig>({ name: 'web-ext', @@ -92,6 +84,12 @@ export async function getInternalConfig( const wxtDir = resolve(srcDir, '.wxt'); const typesDir = resolve(wxtDir, 'type...