I want to link some common code as CommonJS modules, and then use these common modules from another package and / or directly from the global one.
entry1-common.js -- a.js -- b.js entry2-app.js -- x.js inside i would like to to access entry1-common a.js here var moduleA = require('./a.js'); <script> </script>
I am using gulp. Some browser options that I seem to need, but not quite me there:
browserify(bundleConfigs: [{ entries: './entry1-common.js', dest: dest, outputName: 'common.js', hasExports: true, // this gives me require() function on the outside require: ['jquery'] }])
Do I need to bind through and duplexer? I saw examples of this in the documentation browser.
I can create two separate packages in my gulp task, but I don't know how to access modules from one to the other.
source share