Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 933 Bytes

README.md

File metadata and controls

40 lines (24 loc) · 933 Bytes

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.