├── .gitignore
├── Gemfile
├── MIT-LICENSE
├── README.md
├── Rakefile
├── lib
├── rails-vue-loader.rb
└── sprockets
│ └── vue
│ ├── script.rb
│ ├── style.rb
│ ├── utils.rb
│ └── version.rb
├── rails-vue-loader.gemspec
└── test
├── fixtures
├── components
│ ├── card.style.vue
│ ├── card.tpl.vue
│ └── card.vue
└── index.vue
└── test_vue.rb
/.gitignore:
--------------------------------------------------------------------------------
1 | *.rbc
2 | .bundle
3 | *.gem
4 | Gemfile.lock
5 | README.html
6 | doc
7 | docs
8 | pkg
9 | tmp
10 | .DS_Store
11 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | gemspec
3 |
--------------------------------------------------------------------------------
/MIT-LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Kikyous
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # rails-vue-loader
2 |
3 | [](https://rubygems.org/gems/rails-vue-loader)
4 | [](https://rubygems.org/gems/rails-vue-loader)
5 |
6 | rails-vue-loader(formerly sprockets-vue) -- a [Sprockets](https://github.com/rails/sprockets) transformer that converts .vue file into js object.
7 |
8 | # feature
9 |
10 | following tag is supported in .vue file
11 | * script (coffeescript and js)
12 | * template (currently html only)
13 | * style (scss, sass and css)
14 |
15 | # install
16 | add `gem 'rails-vue-loader'` to Gemfile, and run bundle, currently works with sprockets 3.
17 |
18 | # example
19 |
20 | * app/assets/javascripts/application.coffee
21 |
22 | ```coffee
23 | #= require index
24 |
25 | new Vue(
26 | el: '#search',
27 | components: {
28 | 'index': VComponents.index
29 | }
30 | )
31 | ```
32 |
33 | * app/assets/javascripts/index.vue *(stored into VComponents.index when required)*
34 | ```vue
35 | //= require components/card
36 |
48 |
49 |
50 |