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

Example of build flow customization #1

Closed
kirillsalykin opened this issue Jul 6, 2018 · 3 comments
Closed

Example of build flow customization #1

kirillsalykin opened this issue Jul 6, 2018 · 3 comments

Comments

@kirillsalykin
Copy link

Hi, thanks a lot for your work and this great project.
It would help a lot if you can add example of build process customization, for example css files fingerprinting (adding md5 to filename).

@mbuczko
Copy link
Owner

mbuczko commented Jul 9, 2018

Hi,
Sorry for a late answer, I've just came back from vacations.

CSS fingerprinting is definitely something on my todo list. The only thing I still didn't clearly figure out is how transform HTML files/templates, so they could point to valid (fingerprinted) resources. I guess I would need to provide kind of additional templating. Any suggestions?

@kirillsalykin
Copy link
Author

kirillsalykin commented Jul 9, 2018

No problems, hope your rest was good :)

I've been thinking about having another task which will copy index.hml and replace links. but my approach is a bit different from what currently used - I treat index.html as static file (similar to css/js) - thus no selmer used.

@mbuczko
Copy link
Owner

mbuczko commented Sep 2, 2018

a new built-in task has been added - assets which hopfully solves that issue.

assets task takes :source-paths and tries to fingerprint every file inside (along with everything that already has been already created in target/assets directory, used eg. by sasstask). it's possible to exclude some paths with :exlcude-paths (which usually makes sense for scss/sass files which should not be fingerprinted and included into final artifact). the tricky part is to find all assets which refer to fingerprinted ones (like htmls referring to styles/scripts or css-es referring to images) and replace occurences.

to do so a :assets-holders option has added which configures a collection of extensions of static assets in classpath to scan, like ["js" "css" "html"]. All fingerprinted assets found in there will be updated accordingly.

I suggest to take a look at sample revolt-edge in case of any problems.

@mbuczko mbuczko closed this as completed Sep 2, 2018
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

2 participants