Created
March 21, 2014 14:37
-
-
Save bclinkinbeard/9687642 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.env.BROWSERIFYSHIM_DIAGNOSTICS=1 | |
var b = require('browserify')() | |
b.add('./index.js') | |
b.bundle(function (err, src) { | |
if (err) throw err | |
require('fs').writeFileSync('./bundle.js', src, 'utf8') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var angular = require('angular') | |
console.log(angular.version); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "wtf", | |
"devDependencies": { | |
"browserify-shim": "^3.3.2", | |
"browserify": "^3.33.0" | |
}, | |
"browserify": { | |
"transform": [ | |
"browserify-shim" | |
] | |
}, | |
"browserify-shim": { | |
"./angular.js": "angular" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You aren't aliasing
angular
anywhere (viabrowser
field).So you also need to require it via it's path, i.e.
require('./angular')
.