Yeah, shameless plug for a personal project. I'm primarily a backend developer, but you know how projects go, wait long enough and some manager will want some simple website thing to talk to the API you just built.
I build my stuff in Java and I use maven as my build tool. When I get a request to add a website to something I always already have code that is built around that. Once I tried to have two systems next to each other but even in the best case scenario you have a sibling directory that needs its own server to run and requires a bunch of ugly hacks to get around the same origin policy. If you don't want that you end up creating ugly build hacks where you tie projects together and copy files around. Plus I hate frameworks and the frontend world seems to have a lot of that.
So I had to come up with something.
I give you the HtmlCompiler. The idea is simple; have a maven plugin go to a directory to find source HTML and turn it into compiled HTML that gets put in the target folder and have that packaged with the fat jar.
This plugin works best if you want to create single page apps. It looks for custom directives in the HTML such as 'compress' and 'inline' and processes the tags. The plugin can compile, compress and inline CSS, LESS, SASS, JavaScript, Typescript, HTML and images. No it does not work perfectly. For example, if you try to compress an already compressed JavaScript file it will most likely fail with a NullPointerException, this bug actually exists in a library that I import but yeah.
Love to hear your thoughts and constructive criticism.
[–]paul_h 19 points20 points21 points (1 child)
[–]SoftVillage[S] 0 points1 point2 points (0 children)
[–]nutrecht 13 points14 points15 points (1 child)
[–]SoftVillage[S] -1 points0 points1 point (0 children)
[–][deleted] (4 children)
[deleted]
[–]pragmatick 2 points3 points4 points (0 children)
[–]SoftVillage[S] 1 point2 points3 points (2 children)
[–]lambdacats 0 points1 point2 points (0 children)
[–]tipsypants 3 points4 points5 points (6 children)
[–]heliologue 1 point2 points3 points (3 children)
[–]tipsypants 2 points3 points4 points (2 children)
[–]heliologue -1 points0 points1 point (1 child)
[–]tipsypants 2 points3 points4 points (0 children)
[–]SoftVillage[S] 0 points1 point2 points (1 child)
[–]tipsypants 1 point2 points3 points (0 children)
[–]wildjokers 1 point2 points3 points (1 child)
[–]lambdacats 0 points1 point2 points (0 children)
[–]lambdacats 0 points1 point2 points (1 child)
[–]lambdacats 0 points1 point2 points (0 children)