I've been trying to create a project that utilizes AngularJS
, Browserify
and Gulp
for an excellent developer experience, one that produces a distributable 'module' (in Angular parlance). The idea being to have a self-documented project, like Angular Bootstrap
, that also produces a consumable distribution for use in another application.
We've had great results with Gulp
, but we're having trouble with browserify/browserify-shim
. Also, unfortunately, most of the examples out there either don't use gulp, or use gulp-browserify
, which has been blacklisted/ended.
We're including AngularJS
and JQuery
from Google CDN
as <script>
tags and have declared "angular" : "global:angular"
and "jquery" : "global:$"
in our browserify-shim
config in package.json
, but we're getting "cannot find module"
when we try to user var angular = require('angular')
and var $ = require('jquery')
inside of our browserified-code (once it runs in the browser).
I've created a sample project that distills this down close to the minimum.
A sample repository of the code is available at
Once cloned, you would run 'npm install'
, then 'bower install'
, then 'gulp'
from the root of the multi-browserify
folder to generate the files and run the test server.
With gulp running, you can access the live HTML at http://:4000/gulp.html
Any help would be greatly appreciated - I'm wondering if we've come across a bug/issue with the intersection of gulp, browserify, vinyl-source-stream, etc, or more likely, we just don't quite get it yet.