Skip to content

Commit

Permalink
fix: prevent duplicate CSS files after build (#9382)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 9, 2023
1 parent 118ce5a commit 748a872
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-camels-explain.md
@@ -0,0 +1,5 @@
---
"@sveltejs/kit": patch
---

fix: prevent building duplicate CSS files
9 changes: 5 additions & 4 deletions packages/kit/src/exports/vite/index.js
Expand Up @@ -550,7 +550,11 @@ function kit({ svelte_config }) {
new_config = {
base: ssr ? assets_base(kit) : './',
build: {
copyPublicDir: !ssr,
cssCodeSplit: true,
cssMinify: initial_config.build?.minify == null ? true : !!initial_config.build.minify,
// don't use the default name to avoid collisions with 'static/manifest.json'
manifest: 'vite-manifest.json',
outDir: `${out}/${ssr ? 'server' : 'client'}`,
rollupOptions: {
input,
Expand All @@ -564,10 +568,7 @@ function kit({ svelte_config }) {
preserveEntrySignatures: 'strict'
},
ssrEmitAssets: true,
copyPublicDir: !ssr,
target: ssr ? 'node16.14' : undefined,
// don't use the default name to avoid collisions with 'static/manifest.json'
manifest: 'vite-manifest.json'
target: ssr ? 'node16.14' : undefined
},
publicDir: kit.files.assets,
worker: {
Expand Down

0 comments on commit 748a872

Please sign in to comment.