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

svelte-kit build should respect vite.build.emptyOutDir #1044

Closed
milkbump opened this issue Apr 15, 2021 · 3 comments · Fixed by #2260
Closed

svelte-kit build should respect vite.build.emptyOutDir #1044

milkbump opened this issue Apr 15, 2021 · 3 comments · Fixed by #2260
Labels
feature / enhancement New feature or request

Comments

@milkbump
Copy link

Is your feature request related to a problem? Please describe.
Building using adapter-static, files from the previous build are still in the build folder after a subsequent build. Vite has a build.emptyOutDir: true default that svelte-kit seems to ignore.

Describe the solution you'd like
It would be nice if svelte-kit cleared the build directory, to avoid the build folder ballooning in size when doing multiple local builds.

Describe alternatives you've considered
Running rm -rf ./build && svelte-kit build is a good enough workaround for now.

@benmccann
Copy link
Member

Duplicate of #1039

@benmccann benmccann marked this as a duplicate of #1039 Apr 15, 2021
@kayakyakr
Copy link

@benmccann did the fix for #1039 handle rebuild if a file has been removed? I experienced it locally (with version next.89, not sure when that went out) when I removed a .svelte route, the generated html file was still present in build.

@kayakyakr
Copy link

This is still an issue with the latest. Seems like it needs to be an update to adapter-static. Recreation (for me):

  1. Create an app with $layout, index, sveltePreprocess with scss, and adapter-static
  2. In the $layout file, add some global styles
  3. Build the app
  4. Change the $layout file
  5. Build the app again
  6. In the build/app directory, there should now be two files named start.[hash].js

start-breeding

Requesting a reopen.

@babichjacob babichjacob reopened this May 3, 2021
@babichjacob babichjacob changed the title Svelte Kit not emptying build directory SvelteKit should respect vite.build.emptyOutDir May 3, 2021
@babichjacob babichjacob changed the title SvelteKit should respect vite.build.emptyOutDir SvelteKit should respect vite.build.emptyOutDir May 3, 2021
@babichjacob babichjacob added the feature / enhancement New feature or request label May 3, 2021
@babichjacob babichjacob changed the title SvelteKit should respect vite.build.emptyOutDir svelte-kit build should respect vite.build.emptyOutDir May 3, 2021
Greenheart added a commit to Greenheart/greenheart.github.io that referenced this issue Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants