Skip to content

Latest commit

 

History

History

browserify

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

metal-examples-custom-build-browserify

A simple component using soy templates and Browserify.

Since this example is a soy component, it needs to use Metal.js's custom logic for compiling soy templates so they can be integrated with the appropriate Component class. This example uses metal-cli to compile the templates before bundling the code via Browserify.

The Browserify command is included in the build script, so take a look at package.json to check it out. Note that we're using babelify to compile the ES6 code, and using babel-preset-metal with it.

The code has lots of comments explaining how everything works.

Setup

  1. Install NodeJS >= v0.12.0, if you don't have it yet.

  2. Install local dependencies:

npm install
  1. Build the code:
npm run build
  1. Open the demo at demos/index.html on your browser.