Fixing `mix.version` build location


Right now, mix.version creates a build directory and sticks the versioned assets in there. This tends to break relative paths for things like images and files. The workaround is to copy the fonts or images or whatever to the build directory (mix.copy( "resources/images", "includes/build/images" );) but this is slightly annoying.

I see two fixes.

1. Version in place instead of a build directory.

This could even delete the original file (if it exists) once it versions it.

2. Make versioning a Elixir level setting

We would default to false for development (to save time) and true for production.

(Also, we could delete the original file as well as mentioned above.)


Gavin Pickin
April 4, 2017, 8:05 PM

#1 sounds good. Give them control.

Eric Peterson
April 5, 2017, 2:03 AM

I think we should delete the original files if we version them. Thoughts?

Luis Majano
April 5, 2017, 2:06 AM

Hmm, I think so. You are asking for versioned files, so I am guessing it should

Eric Peterson
April 14, 2017, 8:18 PM

Currently the elixir helper method in ColdBox will default to the path if no manifest mapping is found. That means elixir( "js/app.js" ) would point to /includes/js/app.js if there is no versioned file mapped.

With that in mind, what do you think about ignoring the mix.version call if we aren't in production mode. It really just adds time with little to no benefit in development.

Eric Peterson
April 28, 2017, 2:07 PM

This might be as simple as a new default build location. elixir.config.versioning.buildFolder = ".";




Eric Peterson