rails-vue-loader(formerly sprockets-vue)

Gem Gem

A Sprockets transformer that converts .vue file into js object.


following tag is supported in .vue file

  • script (coffeescript and js)
  • template (currently html only)
  • style (scss, sass and css)


add gem 'sprockets-vue' to Gemfile, and run bundle, currently works with sprockets 3.


  • index.vue ```vue //= require components/card

* application.coffee

#= require index

new Vue(
  el: '#search',
  components: {
    'index': VComponents.index
  • application.scss scss //=require index

you can include .vue file in css file, it's style block will be automatic processed. you can also use require_tree to include all .vue file.😘 scoped will not be supported.