Closed yanns closed 10 years ago
It's fine that an external module has a hash. In order to make it work, you need another bundled script with { require: ['react'] }
. Please see node-browserify's README for more details of external
and require
.
One of my personal projects was doing something relevant. I set react
as a dependency in package.json
, created lib.js
whose content is just require('react');
and made it bundled with browserify.
Thanks for the help. I am just surprise that I cannot override this hash.
I am trying to declare a module as external like that:
Sample app: https://github.com/yanns/react-unit-test/blob/master/gulpfile.js#L39
It kind of works, as the react lib is not concatenated with my application javascript. But, in the generated javascript, the module name for react is replaced with an hash like that:
leading to an error in the browser: Uncaught Error: Cannot find module 'TTpHcX'
I tried a lot of different configurations, included those found in https://github.com/deepak1556/gulp-browserify/issues/55
I tried to define alias, but without any success at the moment. Is it a problem with gulp-browersify, or with my configuration?
Thanks for any help.