Skip to content

Latest commit

 

History

History
 
 

demo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

requirejs-vue Sample

This sample demonstrates way to load Vue components with RequireJS

Prepare

Run bower install

This will download necessary libraries into bower_components.

Run

Due to browser's XMLHttpRequest CSRF limitations use a local server to serve files from current directory, for example with Python built-in module:

python -m SimpleHTTPServer 8008 & open http://localhost:8008/index.html

Build with r.js

To create production-ready js bundle we suggest to use r.js optimizer.

  1. Install r.js optimizer:

    npm install -g requirejs
  2. Make app.dist.js by calling

    r.js -o app.build.js

    The combined and minified bundle will be generated for standalone usage.

  3. And then simply open app.dist.html.

Note: currently Vue-component's styles will omitted during build – use standard css instead.