-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tilde extension to allow replacing plugin modules #565
Conversation
This implements the tilde extension `src/system-extension-tilde.js` which makes it easy for plugins to define places that can be replaced by `normalized` and `located` modules. The idea is that a plugin can identify a regular expression (or an array of regular expressions) which will be used to replace moduleNames located in those regular expressions with a full address which has been found by running the module name through normalize and locate hook. This applies replacements for less and css as outlined in issue #277
@@ -70,6 +70,6 @@ function isProduction(){ | |||
return (loader.isEnv && loader.isEnv("production")) || | |||
loader.env === "production"; | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't you take this option away?
I'm wonder if this should be a configDependency rather than in core. I'm not sure about adding 120LOC for such a specific use-case, seems like it would make a nice configDep. |
What would be even nicer is if we had a proper extension system as described in #414 and the StealJS roadmap, that way this could be pushed to NPM. But unfortunately for now moving this into |
This is currently merged into minor (along with progressive package.jsons) so if you need to do any more prerelease let me know. |
to be clear, this PR is replaced by #605 ? |
That's right. |
This implements the tilde extension
src/system-extension-tilde.js
which makes it easy for plugins to define places that can be replaced bynormalized
andlocated
modules. The idea is that a plugin can identify a regular expression (or an array of regular expressions) which will be used to replace moduleNames located in those regular expressions with a full address which has been found by running the module name through normalize and locate hook.This applies replacements for less and css as outlined in issue #277