Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Provide CLI support for Custom Functions #784

Closed
am11 opened this issue Mar 23, 2015 · 1 comment
Closed

Provide CLI support for Custom Functions #784

am11 opened this issue Mar 23, 2015 · 1 comment

Comments

@am11
Copy link
Contributor

am11 commented Mar 23, 2015

Based on #644, we need Custom Functions support for CLI, on a par with API usage.
The functions will have same behavior as importers, except for multiplicity: we can have multiple functions, but we can't have multiple importers (yet).

Options:

  • Provide a single, non repeatable flag --functions, which accepts path value of type string. This path would be a path to .js file with multiple modules.exports. We will use require() and transform into arrays of functions.
  • Provide a repeatable flag --function, which takes path to file with single or multiple module.exports. We will again use require().

Caveat:

(as noted here)
We need to figure out a way to make watcher aware of any changes made in custom function and custom importer, after the first require(). We would probably need to re-require all the modules (after clearing the require.chache['importer/functions']).

@am11 am11 added this to the Unknown milestone Mar 23, 2015
am11 added a commit to am11/node-sass that referenced this issue Mar 28, 2015
* Adds related tests and fixtures.

Issue URL: sass#784.
PR URL: sass#815.
@am11 am11 modified the milestones: 3.0, Unknown Mar 28, 2015
@am11
Copy link
Contributor Author

am11 commented Mar 28, 2015

Merged #815.

@am11 am11 closed this as completed Mar 28, 2015
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

1 participant