Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run tests in SvelteKit app #100

Open
L-Mario564 opened this issue Jul 17, 2024 · 0 comments
Open

Can't run tests in SvelteKit app #100

L-Mario564 opened this issue Jul 17, 2024 · 0 comments

Comments

@L-Mario564
Copy link

It seems there's a conflict between the config file and the SvelteKit config. Here's the logged error:

The following Vite config options will be overridden by SvelteKit:
  - build.outDir

I can't run any tests because of this. Here's are my configs:

// cypress.config.ts
import vitePreprocessor from 'cypress-vite';
import { defineConfig } from 'cypress';

const setupNodeEvents: Parameters<typeof defineConfig>[0]['setupNodeEvents'] = (on) => {
  const vite = vitePreprocessor(`${process.cwd()}/vite.config.ts`);
  on('file:preprocessor', vite);
};

export default defineConfig({
  e2e: {
    setupNodeEvents,
    baseUrl: 'http://localhost:5173',
    // More config options...
  }
});

// vite.config.ts
import 'sharp';
import { purgeCss } from 'vite-plugin-tailwind-purgecss';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [sveltekit(), purgeCss()],
  envPrefix: 'PUBLIC_'
});

// svelte.config.js
import adapter from '@sveltejs/adapter-vercel';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: vitePreprocess(),
  kit: {
    adapter: adapter(),
    alias: {
      // ...
    }
  }
};

export default config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant