dernasherbrezon / fingerprint-maven-plugin Goto Github PK
View Code? Open in Web Editor NEWMaven plugin for web resources optimization
Maven plugin for web resources optimization
It would be great if there was a method of mapping URLs to the filesystem. For instance if my app has a prefix (like /apps
) this plugin won't work by default because the URLs in the HTML won't line up with the file system structure. Something like the following could be useful:
<img src="/apps/app1/logo.png">
and my directory structure looks like this:
src/main/webapp/app1/logo.png
then set the following map in the pom.xml:
<urlMappings>
<urlMapping>
<urlPrefix>/apps/</urlPrefix>
<fsPath>/</fsPath>
</urlMapping>
</urlMappings>
The outcome would be a straightforward find/replace with the mappings. So /apps/app1/logo.png
would map to /app1/logo.png
on the file system.
Let's say your project consists of these files:
index.html
references stylesheet.css
stylesheet.css
references background.png
background.png
Running the plugin once works as expected:
Now you replace/edit the image file and run the plugin again:
It turns out that the plugin uses the hashes of the original source file's contents. But we did not change the source CSS at all - it still references background.png
!
The result is that in the HTML file, the reference to the CSS still has the same hash as before. Therefore, browsers will not reload the CSS, and will therefore not reload the image file!
This problem could be prevented if the plugin calculated the hashes of the modified files, i.e. after it altered the contained references to other resources.
Workaround: do not use any image URLs in CSS. ๐ข
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.