javascript - How to prevent browserify-shim from requiring all shims? -


I am using a browser and browser-sim in a project, run through the pulp-browser.

  gulp.src (['./source/js/main.js']) .Pipe (Browsers ({shim: {angular: {path:' ./node_modules / angular / angular .js', export: 'angular'}, 'angular-conscious': {path:' ./node_modules/angular-animate/angular-animate.js', export: 'ngenet', depends: {angular: Angular ', jquery:' jquery '}}, [...]}}) .pip (concat (' app.js')) .pipe (gulp.dest ('./web / js'));   

This setup works fine and for the most part, as intended, however, always all shimmed libraries in the browser will be included in the build, even if they are From < Strong> No is required ()

Documentation is not present on this subject. Is there any way to stop it? It seems very intuitive for me - build

(Update: I have installed angular and other labs using NPM / NPM)

When you roam with browser fi rst, it is available for those libraries ( And especially the items you tell for "export") is making the global, this conference still needs to use for those libraries () , however, to do so Just the best practice so that the library can change the library to module.exports , you will not need to change the global context in your code. Also, it's better to list all the files you need at the top in the best node form. :)

To answer those questions, by shaming those libraries, you have told the browser to include them as a physical variable so that they can be used anywhere, So that they can join the creation without any automatic form if you need () .

If you do not want to include anything else on the basis of something like gulp.env , then you can try building the building object separately and in the BrowserFire function Pass.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -