-
Notifications
You must be signed in to change notification settings - Fork 26
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
Aliasify code in modules #26
Comments
+1 to this—I just spent an hour trying to figure out what was wrong in my configuration (where I was trying to aliasify underscore to lodash for use in a required Backbone), but it seems that aliasify, as with the browser field, doesn't affect anything within your node_modules directory. If this is the case, that should be added to the documentation. To clarify, I'd have expected this to work: demo.js: module.exports = require( 'backbone' ); package.json: {
"scripts": {
"test": "browserify demo.js | grep lodash"
},
"browserify": {
"transform": [ "aliasify" ]
},
"aliasify": {
"aliases": {
"underscore": "lodash"
}
},
"dependencies": {
"backbone": "^1.2.1",
"jquery": "^2.1.4",
"lodash": "^3.10.0"
},
"devDependencies": {
"aliasify": "^1.7.2",
"browserify": "^10.2.6"
}
}
|
This is a restriction imposed on us by browserify. Browserify will never run transforms on modules. You might try the new |
@jwalton I just discovered the I'd vote to have that caveat mentioned in the documentation, but thanks for the response and for making a very useful tool! |
@jwalton Good to know the |
I have an project that requires a library which uses the request library. For it to work in the browser i have to swap that for the browser-request.
Is there a way for aliasify to update requires in dependencies?
The text was updated successfully, but these errors were encountered: