Use this repository for when you want to start a new modular JavaScript application that gets compiled by Browserify. You start off with three JavaScript modules in the src/scripts
directory.
hello.js
- Exports a simple function that says hellogoodbye.js
- Exports a simple function that says goodbyesandwichMaker.js
- Exports an object with a single method namedplaceOrder()
main.js
- Contains the logic of your application. It imports the other three modules, and invokes all of the functions.
- Clone this repository.
cd browserify-boilerplate/src/lib
npm install
grunt
The web server will be started, and the JavaScript code in the src/scripts
directory will be compiled into public/hellogoodbye.js
.
- Open Chome and make sure your developer tools are open.
- Open http://localhost:8080 in your browser.
- You should see the following output in the console.