Closed ekkis closed 8 years ago
Are you running browserify-shim as a global transform?
thanks for the quick reply. I'm not sure I understand. the "browserify": { "transform": ... }
specifies that? please elaborate?
ah. I think I understand your question now. I use grunt-browserify
with the following definition:
grunt.initConfig({
browserify: {
libs: { files: { 'inc.js': ['index.js'] } },
}
});
and somewhere down below:
grunt.registerTask('build', [ 'browserify' ]);
Alright, I'm going to go ahead and close this out. Seems like you just need to figure out how to run a global transform in your setup.
I need a global transform (I'm not sure I know what that is)? is there documentation you could point me to?
I'll let you take it from here, hope this is helpful
I read through that article. I had already come across it. but it's a question without an answer. if I need a global transform (not sure I understand quite what it is) then it seems it's just not available. so I cannot browserify this library. is that the answer?
one other thing I don't understand: if you're suggesting that I need a global transform, why? I only have one module that has a dependency on another. perhaps I've expressed it incorrectly but global transforms are for when you have lots of modules that all need a dependency and you want to specify it in a blanket manner, no?
hei. it's been pointed out to me on IRC that github isn't meant for usage questions and I should ask on SO. sorry about that. I didn't realise. I'll post on SO, and thanks for the help
I'm trying to use the linkurious library (a sigma fork), which provides a
"main": "dist/sigma.require.js"
(in thepackage.json
). this allows me to do:var sigma = require('linkurious');
however, the plugins are not included so I have to require them separately. the problem is that the plugins rely on the
sigma
variable being available in the global scope. so I've shimmed things as follows (from thepackage.json
):which, when run in a browser doesn't generate errors during inclusion of the plugins (which I gather means the global variable is available) but references to the plugins fail (as if they failed to attach themselves, or attached themselves to a non-global variable).
I've attached a little project to this issue with the minimal required code to demonstrate the problem in the hopes that someone else can replicate/figure out. unpack, type
npm start
and run a browser againsthttp://localhost:8002/
to see the issue.thanks in advance,
ekkis
sigma.zip
- edit I -
forgot to mention, before running:
npm install