These are chat archives for jescalan/roots

22nd
Feb 2016
Jeff Escalante
@jescalan
Feb 22 2016 20:53
:+1:
@GaryHomewood the != executes a jade function. the roots plugin css-pipeline adds a local function to jade that drops the path to the css file. search github roots css pipeline to check out the repo!
@unitedflags you're most welcome! thanks for finding the setting.
@eholzwarth there are release notes for 4.0.0 in the releases section. Now also for 4.0.1!
Ryan Matsikas
@rmatsikas
Feb 22 2016 21:35
is there an easy way to include a build version when doing a production build?
Jeff Escalante
@jescalan
Feb 22 2016 22:56
what do you mean build version
you could just hash the time as a local and print it into your layout
we don't have build versions though, just builds
Ryan Matsikas
@rmatsikas
Feb 22 2016 22:58
like a semver increment, x.x.x style
even a way to inject a build date would b eok
Jeff Escalante
@jescalan
Feb 22 2016 22:58
inject to where?
for any sync js method you could just add it as a local in app.coffee
for anything async, would probably be easiest to write a small plugin
would be a nice plugin idea to have one that injected the latest git tag as a html local. definitely could be accomplished
if anyone wants to get into the plugin game
Ryan Matsikas
@rmatsikas
Feb 22 2016 23:00
hmm ok, ill investigate that.. thanks
Jeff Escalante
@jescalan
Feb 22 2016 23:03
you know what i'm talking about with locals?
Ryan Matsikas
@rmatsikas
Feb 22 2016 23:03
ya, I have an application object I was hoping to inject into
but locals might work
there is the after compile hook also?
Jeff Escalante
@jescalan
Feb 22 2016 23:06
what is an application object
is it an html file?
css?
javascript?
other script?
Ryan Matsikas
@rmatsikas
Feb 22 2016 23:06
js
Jeff Escalante
@jescalan
Feb 22 2016 23:06
you can't inject locals into a js file, so you'd have to have js read it from the html
drop it into a script tag as a global variable, or read it out of a hidden element
there's an after compile hook, yes
Ryan Matsikas
@rmatsikas
Feb 22 2016 23:07
ya the output html from roots isnt being used though, im just handing off js/css to the backend guys
Jeff Escalante
@jescalan
Feb 22 2016 23:07
ah, that makes it tough. it's not a roots limitation, the "no injections to js" thing
no js compilers let you inject code at compile time
writing the file direct is too dangerous
you could have it write a new file that just contained the version, then have the js read it out of that file
Ryan Matsikas
@rmatsikas
Feb 22 2016 23:09
write to a file and have it concat to my output js perhaps?
Jeff Escalante
@jescalan
Feb 22 2016 23:21
its very tough to get things injected into js
also depends a lot on what kind of module system you are using
and which bundler
Ryan Matsikas
@rmatsikas
Feb 22 2016 23:23
browserify, coffee, jade.. pretty standard
Jeff Escalante
@jescalan
Feb 22 2016 23:39
really its up to browserify how you can inject