1

I managed to shim angular with this in package.json

"browser": {
"angular": "./bower_components/angular/angular.js",
"ngRoute": "./bower_components/angular-route/angular-route.js",
},
"browserify": {
   "transform": [
      "browserify-shim"]
}
"browserify-shim": "./config/shim.js"

and this in shim.js

module.exports = {
  'angular'    :  { 'exports': 'global:angular' },
  'ngRoute' :  { }
};

This way I can include angular in a separate script tag and it won't be bundled by browserify. However I can't figure out how to do the same for ngRoute. Would really appreciate some help.

1 Answer 1

2

I will do as follows:

  1. Remove browserify-shim

  2. Use debowerify in browserify instead

  3. Use bower to install angular and angular-route

  4. Write an app.js as follows to browserify

require("angular");

require("angular-route");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.