Closed Bradley-H closed 4 years ago
Do you have a reproduction? Is the issue that files from previous builds aren't getting deleted? If you delete the __sapper__
directory and rebuild (once), do all of the duplicate files reappear?
They don't reappear, when I delete the sapper folder. However, when I save they aren't being replace.
If this is happening when you're running npm run dev
and then making subsequent edits to the site while the dev server is running (which triggers more rebuilds), this is expected and not a problem. If you're seeing it when running npm run build
, that is a problem, because that's supposed to clear the directory first.
I don't think that is a good design philosophy. Imagine if you will sapper is being used in a full enterprise level website, that is going to clutter up my disk space after an entire day of work if not part of the day at work and I don't think it's a good idea to stop what I'm doing, delete my sapper directory, run npm run dev and pick up where I left off or vice a versa.
@Bradley-H Is this during dev
or build
?
Sapper doesn't really have too many opinions about how you set up your dev environment so we leave these kinds of choices to the user. As such, I'm afraid this isn't a feature we are interested in implementing right now.
However it is pretty easy to add using something like rollup-plugin-delete
.
You should just be able to add the following to your client rollup config and get the desired behaviour:
export default {
client: {
...config,
plugins: [
...other_plugins,
del({ targets: '__sapper__/*' })
]
},
server: { ... }
}
Currently when i make a sapper project, and I check my sapper/client, i'm overwhelmed by how many index.js files i have that are almost identical in content.
I updated Sapper, Svelte, Polka, Sirv, rollup, and I'm still getting this.