javascript - How to create vendor bundles with latest Browserify (6.x.x)? -


Well, now we are using BrowserFet 2.x for a while. We are going through some refactoring so that we want to update the latest browser in the future to reduce the future leap forward.

Unfortunately some external bundles are controlled. In the old version we can simply tell Browserify, which requires the modules to be excluded from the bundle and they need something else - basically what it is.

Version 5.0.0 has some major changes in BrowserWorld Internal. Let's take this command for example. The debug module is the NPM module.

  BrowserFiD Debug-o vendor.js   

Running this command in the browser command @ 4, the output file will look like this:

  requirement = (function ... {"debug": [function (required, module, export) requires {module.exports = ('2 BVKWP'));}, { }}, "2 BVKWP": [function (requirement, module, export) {// actual code debug module}, {}]});   

now looks like Browserify @ 5:

  required = (function ... {1: [function (required, module, export ) {// actual code from debug module}, {}]});   

To complete the equation, I have a simple file that requires ('debug') and it is bundled with the command browserify -x debug -e Index.js -o main.js Internal dependency is set to the debug module on the undefined , which is fine.

If you want to see the file, then the argument is that just using the pre-defined global requirement ( pastRequIRE stored in the variable) The module is not to be defined in the current bundle but since it does not reveal anything like vendor.js module, then it can not be successful.

All I'm able to find is the change:

Hashing has been exposed: For accurate-export bundles, the right or explicit exposure ID is required.

What I can not find is actually the meaning: (

You should be able to create your own seller bundle in this way:

  browserify -r debug> vendor.js   

and then your app bundle Make:

  Browser application The ordering index.js -x debug & gt; main.js   

it works just fine (I am using browserify@6.1.0 ) .

Actually, even if is required ('debug'); will not work in the browser console, as a browser in the seller bundle Debug module until the bundles are loaded into correct order, i.e.

  



  

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -