These are chat archives for jescalan/roots

Oct 2015
Andy Shora
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
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
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
Andy Shora
Oct 23 2015 16:18

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

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

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

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

    sourcemap: true

    pretty: true

    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
Oct 23 2015 16:24
...So I'm not too experienced with the write option of dynamic content, but judging from your 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
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
Oct 23 2015 17:21
@andyshora my response didn’t pertain to your issue. sorry for the confusion
Oct 23 2015 17:59
can we use this?

PostScss NPM
node-sass + PostCss = PostScss.

PostScss compiles SASS into CSS then runs PostCSS plugins.