brianwyka / brackets-clientlibs-combine

Brackets plugin which combines clientlib files
https://registry.brackets.io/
MIT License
3 stars 1 forks source link

File Watcher for non-open files? #1

Open mihawk90 opened 9 years ago

mihawk90 commented 9 years ago

TL;DR; Watch option that triggers combine on file change on disc, not save in brackets.


Heya. I have a little situation here, my structure is like this (using html5boilerplate):

root
 |-- css
  |-- normalize.css
  |-- main.css
  |-- style.scss
 |-- js
 |-- img
 |-- [additional files]

Note the style file is scss. I'm using Brackets SASS for compiling and this works all great, no problem. Now my issue at hand is that I want to combine my regular css files and the generated CSS from SASS. Apparently SASS won't do this on it's own when using a import directive (see sass/sass#556), so I was thinking to use this extension to do the job.

I used this config:

"combineOnSave": true,
"combine": [
    {
        "output": "css/headlibs.css",
        "files": [
            "css/normalize.css",
            "css/main.css",
            "css/style.css"
        ]
    }
]

But (as I expected as the option "OnSave" suggests), the extension doesn't watch the files permanently and only triggers on save. I suspect the same is true for JS files, but as I'm using the JSCompiler extension this works out just fine since that it's doing this on its own.

wykapedia commented 9 years ago

The problem isn't that the file isn't open. The combineOnSave feature is triggered when the document is manually saved. Since the file is being updated behind the scenes by the other extension, I'm not sure that it is triggering the "documentSaved" event.

mihawk90 commented 9 years ago

Yeah that's what I thought, I think I actually tried letting the generated css opened in the background.

I don't know if brackets has a method on it's own to watch files (like it's possible with grunt.js, I think - never used it). Though brackets seems to watch opened files at least (since changes made outside brackets are shown as soon as the file is saved externally), so there might be a hook or something.

I have no idea of brackets extension development though :/

I don't know if this is helpful, as well as this (see change)