Comments (6)
This is not an aliasify issue, but a browserify one.
A transform is only applied to source files, not node_modules
If you wish to apply aliasify to all files, you should run it as a "global transform"
(I had the same problem, and found this out via browserify/browserify#501)
from aliasify.
Yes you seem to be correct. Whenever specifying the transform, we seem to need to set global
i.e.
bundle.transform('aliasify', {
aliases: {
'backbone': 'exoskeleton'
},
verbose: true,
global: true
})
Apologies for the confusion, I guess that's down to me being unclear as to how transforms work. There's a lot of the Browserify documents to digest!
from aliasify.
Seems to not work for me, I have:
"browserify": {
"transform": [
["aliasify", {
"global": true,
"debug": true,
"aliases": {
"react": "preact-compat",
"react-dom": "preact-compat"
}
}]
]
},
and still get plenty of:
Error: Cannot find module 'react' from '/Users/tj/dev/src/github.com/tj/vitals/client/node_modules/react-router/lib'
Error: Cannot find module 'react' from '/Users/tj/dev/src/github.com/tj/vitals/client/node_modules/react-router/lib'
I tried adding the package.json config as mentioned in the readme, but that seems to have no effect. Any suggestions?
from aliasify.
I'm having an almost identical problem but with trying to use Exoskeleton
with backbone.nativeview
. My problem is the same as yours though; Aliasify will cycle through my SOURCE FILES, but ignores looking in the dependencies that I have in my node_modules
folder.
[10:07:42] Starting 'scripts'...
aliasify - /var/www/planner/app/static/js/src/main.js: replacing backbone with exoskeleton
Browserify Failed: Cannot find module 'backbone' from '/var/www/planner/app/static/node_modules/backbone.nativeview'
[10:07:42] 'scripts' errored after 854 ms
How do we make Aliasify cycle not just our source files, but the dependencies loaded from node_modules
?
from aliasify.
This might help with defining global transforms in the package.json:
from aliasify.
Breaks on const
's, seems like it's working now otherwise!
from aliasify.
Related Issues (20)
- Resolve index.js when no file is provided HOT 3
- Support .jsx files HOT 3
- working with folders ?
- Aliasify code in modules HOT 4
- Support passing falafel option (for ecmaVersion 6) HOT 1
- Does aliasify work with CoffeeScript files? HOT 4
- Alias and dot notation HOT 2
- Is there support for bower installations with aliasify? HOT 1
- regex in aliases HOT 2
- how to ignore the non-css file HOT 6
- support for alias value of false like the browser field, maps to empty module HOT 2
- Directory separator should be / always HOT 1
- Does not work if code contains ES6 syntax HOT 12
- No value is exported from my es6 module after applying aliasify transform HOT 7
- Not working with Vue? HOT 6
- Always resolve relative urls relative to package.json
- Replace sub-module's relative require HOT 6
- i can haz path? HOT 2
- aliasify doesn't work with split-require
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliasify.