These are chat archives for jescalan/roots

23rd
Oct 2015
Andy Shora
@andyshora
Oct 23 2015 15:57
Anyone know how to stop roots watch triggering a compile when a json file changes?
I'm getting an infinite compile loop going on, as the dynamic content extension is creating a json file
I've added '*/.json' to ignores but no luck
Declan de Wet
@declandewet
Oct 23 2015 15:59
So that glob says "look for a file called ".json" in any top-level folder"
Try "*/.json"
Oh wait
What on earth - gitter appears to be formatting the glob incorrectly. Maybe try ignoring the absolute path to the file? See if that does anything
Seth Krasnianski
@sethkrasnianski
Oct 23 2015 16:04
in roots 2.x I was overriding the port with PORT=n roots watch… did this change in roots 3.x?
nevermind :D
--port
Andy Shora
@andyshora
Oct 23 2015 16:18

@declandewet thanks but didnt fix. Would you mind taking a look at my app.coffee file?

dynamic_content = require 'dynamic-content'
js_pipeline     = require 'js-pipeline'
css_pipeline    = require 'css-pipeline'
records         = require 'roots-records'

module.exports =
  ignores: ['readme.md', '**/layout.*', '**/_*', '.gitignore', 'ship.*conf', '**/*/.*.swp', '**/*/*~', '*.json']

  extensions: [
    dynamic_content(write: '../content.json'),
    js_pipeline(files: ['assets/js/main.js', 'assets/js/slider.js']),
    css_pipeline({
      files: 'assets/css/styles.scss',
      out: 'css/main.css'
    }),
    records(
      content: { file: 'content.json' }
    )
  ]

  'coffee-script':
    sourcemap: true

  jade:
    pretty: true

  server:
    clean_urls: false

I'm struggling with the paths of the json files

I couldnt find any examples of dynamic content and records being used together, but it only works if I do this
It's just not compatible with roots watch
@sethkrasnianski thanks but I dont understand, what did you type in the terminal?
Declan de Wet
@declandewet
Oct 23 2015 16:24
...So I'm not too experienced with the write option of dynamic content, but judging from your app.coffee I'm seeing a bit of conflict - could you explain what your use case is? The reason I ask is because it looks like you're using dynamic-content to write out a JSON file, and then read that same JSON file in using roots-records, which to me, does not make sense - can't you just reference the locals provided by dynamic-content if you need them?
Dominic Monroe
@SevereOverfl0w
Oct 23 2015 17:14
@declandewet This might be the attempt at working around the issue with dynamic-content and having all the data accessible everywhere
Seth Krasnianski
@sethkrasnianski
Oct 23 2015 17:21
@andyshora my response didn’t pertain to your issue. sorry for the confusion
oliver41
@oliver41
Oct 23 2015 17:59
can we use this?

PostScss NPM
node-sass + PostCss = PostScss.

PostScss compiles SASS into CSS then runs PostCSS plugins.
https://github.com/nicbell/postscss