at-import / node-sass-import-once

Eyeglass style Import Once, but for all the things!
Other
94 stars 23 forks source link

Contents of `done()` console.log'd out #2

Closed Snugug closed 9 years ago

Snugug commented 9 years ago

When run successfully, the object passed to done() gets console.log'd out, even without me doing so. Not sure if it's related to gulp-sass or node-sass

Snugug commented 9 years ago

@akhleung @am11 @andrew @dlmanning thoughts on why this may be happening?

Snugug commented 9 years ago

@Jakobo @chriseppstein too

am11 commented 9 years ago

@Snugug, that was due to https://github.com/sass/node-sass/pull/615. A temporary hack which is supposed to be fixed in v3 stable.

BTW, you can search node-sass issue tracker to figure out this kind of thing..

Snugug commented 9 years ago

Didn't quite know what I was looking for there, haven't seen many people doing things with custom importers. Thanks!

jakobo commented 9 years ago

As an aside, the code as written also has some issues. Since the importedFiles is loaded once for the module, multiple calls to node-sass with this importer will reuse the object literal.

This is a known bug in eyeglass. The addition of a context object (v3) should make it possible to maintain a per-render cache inside of the this keyword. It'll actually trip you up in any build pipeline, since gulp/grunt/broccoli/etc just reuse the same options file each time.

function importer(uri, prev, done) {
  var isRealFile = fs.existsSync(prev),
      file;
  // new!
  if (!this._importOnceCache) {
    this._importOnceCache = {};
  }
  // ...
Snugug commented 9 years ago

Ooo, like. I was just running simple things trying to get a basic version of this out, but I'll circle back to that. Thanks!

andrew commented 9 years ago

@snugug there's no need to mention everyone involved, anyone who's watching the repo will get an email about new issues and comments.

Snugug commented 9 years ago

Yah, my brain wasn't functioning last night when I wrote those issues, sorry about that. Thought I would as no one was watching this repo at the time.

On Mar 14, 2015, at 4:41 AM, Andrew Nesbitt notifications@github.com wrote:

@snugug there's no need to mention everyone involved, anyone who's watching the repo will get an email about new issues and comments.

— Reply to this email directly or view it on GitHub.