Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Bundling! 🤘 #36
Bundling! 🤘 #36
Changes from 1 commit
eae58cd
4aa93d6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think overall the correct behavior is to simply copy files from the
/public
directory as-is, as you‘ve done here. But I wanted to highlight that.scss
files end up in the final build in/public
when we don‘t need them.But this begs the question: if we ignore Sass, what else do we ignore? I think it‘s better behavior to not try and treeshake a user’s assets (e.g. they may just want to have download links or serve files publicly). But that said, what if we ignored Sass files, and only Sass files for now? There‘s not really ever a scenario where these need to be public, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to just be very explicit about zero building going on in the
public/
directory, and every file getting copied over 1:1. If you put a Sass file in the public directory, you must want it hosted for some reason. Otherwise, move them intoastro
(ex: you can create your ownastro/styles
folder for external styles that need to be built)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason that this is copying over public is that dynamic components mean you can't statically analyze the pages to determine what assets are used.
Agree on treating public files as just bytes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, if we wanted to do some optimization like image optimization in the future, how hard would it be to provide a hook into this? Or is that something to just worry about later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this process is very much an MVP one and I'm not sure what a final version will look like. This is doing some stuff that presumably we'd prefer Snowpack do, but that would take a bit of work to refactor snowpack to allow. So extensibility was not really thought about at all at this time. So if you need to add something, just add whereever.