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

Add ability to detect files not included in the config #1

Open
scalvert opened this issue Oct 18, 2018 · 2 comments
Open

Add ability to detect files not included in the config #1

scalvert opened this issue Oct 18, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@scalvert
Copy link

Our app uses a TON of engines and in-repo addons. It would be great to detect when the build had files that weren't present in the config. Conversely, it would be great to also detect if there were config entries present that were not represented by real files.

It could be possible to implement this using fs-tree-diff, which would allow us to have human readable output indicating whether something was missing on one side or the other.

@simonihmig
Copy link
Member

It would be great to detect when the build had files that weren't present in the config

Not sure about this. The default config only covers .js and .css files, because these are the ones that get linked from the index.html file, and as such directly affect the loading time. But other files like images are not covered by default, as they might be loaded mostly on-demand (i.e. when visiting certain routes) and as such don't need to count against some size budget.

Your suggestion would treat those files as some kind of error, or what kind of detection did you have in mind?

Conversely, it would be great to also detect if there were config entries present that were not represented by real files.

Agree this can be useful, as this seems to be a sign of a misconfiguration...

@simonihmig simonihmig added the enhancement New feature or request label Oct 23, 2018
@scalvert
Copy link
Author

I think we could narrow what we're detecting to .js and .css, as those are the types that we're actually concerned about. It would be fairly simple to cross reference this in the dist to determine what the list of files was.

Your suggestion would treat those files as some kind of error, or what kind of detection did you have in mind?

Yes, precisely. I think this only works if you have that sort of detection present. Otherwise, it's possible for people to add new files (think engines) without ensuring they're present in the config.

We've been running something very similar to this at LinkedIn in our flagship app. We have ~100 in repo addons and engines, so you can imagine it's pretty gnarly to deal with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants