POST-SOLUTION EDIT
Here's a Yeoman generator to scaffold out a project with Foundation and Browserify: https://github.com/dougmacklin/generator-foundation-browserify
I'm trying to figure out how to properly bundle the foundation framework js with browserify.
In my project folder, I install it along with jQuery (which it depends on):
npm install jquery foundation-sites --save Then in my main.js I have the following:
var $ = jQuery = require('jquery'); var foundation = require('foundation-sites'); $(document).foundation(); I include the $ = jQuery = ... because if I don't I get a jQuery is not defined error.
The js components don't work, however. For example, alert elements fail to close properly.
<div data-alert class="alert-box"> <!-- close functionality not working --> <a href="#" class="close">×</a> </div> If it helps, here is a plunkr that includes my index.html, main.js, bundle.js, package.json and gulpfile.js.
I'm still getting my feet wet with browserify, should I be using browserify-shim for this or am I doing something else wrong?