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

support for asset hashing #125

Open
kylemac opened this issue May 24, 2016 · 3 comments
Open

support for asset hashing #125

kylemac opened this issue May 24, 2016 · 3 comments

Comments

@kylemac
Copy link
Contributor

kylemac commented May 24, 2016

since we swapped static-dev/file-loader for static-dev/source-loader, we lost the ability to [easily] hash the output paths. we overlook this at times because netlify handles it for us, but in instances where we have to host somewhere else, this is a valuable feature.

We can use the loader-utils package to hash the name on the way out (ref)

cc @rmfarrell

@jescalan
Copy link
Member

One issue we'll run into here is that when the assets are hashed, you can reference them by require-ing their path in any given file in order to get the reference to resolve correctly. However, we have removed parsing for require from our jade process, and I think it also will not work for css. So we either have to hack the jade compiler again to bring this back in, or come up with another way to ensure that even hashed asset paths can stay consistent.

@kylemac
Copy link
Contributor Author

kylemac commented May 24, 2016

true. i bet we can find a nice way to handle this though. we're pulling the data/info we need for it in some form already

@jescalan
Copy link
Member

So looking at this again, I feel like the way to take care of it would be a pair of plugins for postcss/posthtml that would grab and replace asset paths with hashes. These two libraries already parse the trees, so it shouldn't be an issue for us to isolate asset paths. As long as they both use the same hashing technique, they will generate matching hashes and all will be well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants