Closed dragonflypl closed 7 years ago
I'm not entirely sure if I understand your question.
If you're looking to version the files, whether they're *.min.js
or *.js
, you would just treat them like any other gulp stream. If need be, create a new task that sources these files directly.
If you're trying to serve these files, you can get ideas from the Integration guide. Approach #3, the PHP example, would work just fine for you, but you'd have to configure your server's side of things.
Another idea: Since there's no need to version files in development, you change your script-handling to:
<%= if (isProduction) %>
<script src="build/js/app-vendor.min.js"></script>
<script src="build/js/app-gom.min.js"></script>
<script src="build/js/app.min.js"></script>
<%= else %>
<script src="build/js/app-vendor.js"></script>
<script src="build/js/app-gom.js"></script>
<script src="build/js/app.js"></script>
<%= end %>
And then just only include gulp-rev
within your production task chain, as well as the gulp.rename
modification.
Thanks, that's what i needed.
In Spring MVC application I have a set of script tags that in
src
attribute have a variable that drives which file version is used:<%=jsSuffix%>
- it is set using application configuration settings during the runtime (long story but I think it has to stay this way):Unfortunately
gulp-rev
&gulp-rev-replace
does not match this syntax with physical file names (app-vendor.js
andapp-vendor.min.js
).Can this be achieved?