import { defineConfig } from 'vite'; // Builds two CSS entries with no plugin in the graph, isolating Vite's own bundled postcss-import, // whose `skipDuplicates` option is the deduplication StylesheetsBundleTest.php pins: // resources/css/all.css, and tests/Fixtures/dedup-app.css, an application-shaped entry importing // per-component stylesheets that share button.css. A stylesheet several files import lands once // per entry, at its first position. // // Not the Workbench's config: this one carries no plugin, which is what isolates Vite's own // postcss-import above. The Workbench's config carries laravel-vite-plugin, so its build is not // this dedup test's to run. // // DEDUP_OUT_DIR is required: the test builds into a temporary directory and deletes it, and nothing // should land in the package's own tree, least of all workbench/public/build. if (!process.env.DEDUP_OUT_DIR) { throw new Error('Set DEDUP_OUT_DIR to the directory the dedup fixture should build into.'); } export default defineConfig({ publicDir: false, build: { outDir: process.env.DEDUP_OUT_DIR, emptyOutDir: true, manifest: true, rollupOptions: { input: ['resources/css/all.css', 'tests/Fixtures/dedup-app.css'], }, }, logLevel: 'silent', });