Skip to content

Work In Progress: feature: use node-sass's importer hook to help tools track dependencies.#25

Open
cgc wants to merge 1 commit intodavidguttman:masterfrom
cgc:sass-importer
Open

Work In Progress: feature: use node-sass's importer hook to help tools track dependencies.#25
cgc wants to merge 1 commit intodavidguttman:masterfrom
cgc:sass-importer

Conversation

@cgc
Copy link

@cgc cgc commented Apr 5, 2015

noticed that a hook into sass's @import() statement was recently added to node-sass, so I figured I'd take a stab at writing integration for it! closely follows similar changes to jadeify and lessify, as well as a similar change for a different static asset manager.

This change depends on benbria/browserify-transform-tools#10

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a bit aggressive to do every possible file, but the alternative is fs.exists. Not sure which is more/less intrusive?

@cgc cgc changed the title feature: use node-sass's importer hook to help tools track dependencies. Work In Progress: feature: use node-sass's importer hook to help tools track dependencies. Apr 5, 2015
@cgc
Copy link
Author

cgc commented May 2, 2015

ping @davidguttman

@davidguttman
Copy link
Owner

Hey, really sorry for the delay on this!

I'm not entirely sure what this is for, but I'm all for it if it adds something you want/need and doesn't affect previous functionality.

As for the specific questions you had:

  1. fs.exists is fine with me -- I'd go with the option that is more clear.
  2. mocha is ok, personal preference is tape
  3. All tests should be run from npm test

@cgc
Copy link
Author

cgc commented Aug 7, 2015

Hi @davidguttman,

This change uses a relatively new feature in node-sass to report @import()ed files to watchify (using the file event). In this PR's test case, the files something.scss and _settings.scss are reported to browserify as dependencies of main.scss, so watchify will recompile main.scss if either something.scss or _settings.scss are modified. This can really improve the watchify development process for projects that use @import().

npm test sounds good. I'll look into tape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants