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

gatsby build doesn't clean all old build files #2751

Closed
baseten opened this issue Nov 2, 2017 · 2 comments
Closed

gatsby build doesn't clean all old build files #2751

baseten opened this issue Nov 2, 2017 · 2 comments

Comments

@baseten
Copy link

baseten commented Nov 2, 2017

Multiple copies of app-*.js and component--src-*.js are added during gatsby build.

app-*.js file seems to be created every time whereas component--src-*.js files only during some builds. I'm having to run rimraf during prebuild to workaround this at the moment.

@KyleAMathews
Copy link
Contributor

We consider having having old copies of js files a good thing. The reason is that gatsby sites are single page apps so someone could leave a site open for a while and then click to a new part of the site which will trigger fetching new JavaScript. If you've redeployed since they opened the site and deleted older js then the user's request will fail.

tl;df it's perfectly safe and a good thing to do to leave older copies of JavaScript bundle files around which is why we don't delete them automatically (like we do html files).

@theredwillow
Copy link

Could you figure out a way to clean files that have been touched though? Simple file renaming is identified by source control, but I have to remember to run clean for Gatsby.

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

3 participants