vuejs-webpack-rails 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/vuejs_webpack_rails/install_generator.rb +20 -3
- data/lib/generators/vuejs_webpack_rails/templates/{vue.config.js → config/vue.config.js} +0 -0
- data/lib/generators/vuejs_webpack_rails/templates/webpack/application.js +10 -0
- data/lib/generators/vuejs_webpack_rails/templates/webpack/components/hello/index.vue +15 -0
- data/lib/generators/vuejs_webpack_rails/templates/webpack/components/index.js +3 -0
- data/lib/generators/vuejs_webpack_rails/templates/webpack/concerns/http.js +13 -0
- data/lib/generators/vuejs_webpack_rails/templates/webpack/concerns/index.js +1 -0
- data/lib/vuejs/webpack/rails/version.rb +1 -1
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69f4d2778f240f33f5e14dcfdabe1f5dcbf5dc8e
|
4
|
+
data.tar.gz: a699370aee3bfd29ea4274d3ce6ca5a52f702786
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b7e9c4b2616b1d30553e3249782d3e1abbd205b77f3c25aad45ac40cc93e9bb6a7fcdbac0cca75540a4f92e6c92720ba7dae21973150651fc8a135ebe460959
|
7
|
+
data.tar.gz: 82440dcfb5a54e5743668bcfa8c2c5903347d0d17a3057ad1854dfac05aae4b732068de1733129f3af34fd9fc624f3dc3fb6f34f46722fbd70175eae936b0ebb
|
@@ -9,8 +9,9 @@ module VuejsWebpackRails
|
|
9
9
|
generate "webpack_rails:install"
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
|
12
|
+
def copy_files
|
13
|
+
directory 'config'
|
14
|
+
directory 'webpack'
|
14
15
|
end
|
15
16
|
|
16
17
|
def modify_webpack_config
|
@@ -59,7 +60,7 @@ module VuejsWebpackRails
|
|
59
60
|
end
|
60
61
|
|
61
62
|
def install_packages
|
62
|
-
install_npm_packanges '-S', *%w(vue lodash)
|
63
|
+
install_npm_packanges '-S', *%w(vue lodash vue-resource)
|
63
64
|
install_npm_packanges '-D', *%w(webpack-manifest-plugin extract-text-webpack-plugin webpack-merge)
|
64
65
|
install_npm_packanges '-D', *%w(babel-core babel-loader babel-runtime babel-plugin-transform-runtime babel-preset-es2015)
|
65
66
|
install_npm_packanges '-D', *%w(coffee-loader coffee-script)
|
@@ -68,6 +69,22 @@ module VuejsWebpackRails
|
|
68
69
|
install_npm_packanges '-D', *%w(vue-loader vue-hot-reload-api vue-template-compiler)
|
69
70
|
end
|
70
71
|
|
72
|
+
def print_message
|
73
|
+
say <<-MESSAGE.strip_heredoc
|
74
|
+
|
75
|
+
== Vuejs + Webpack + Rails ==
|
76
|
+
|
77
|
+
1. Please add below line to your layout(app/views/layouts/application.html),
|
78
|
+
this is loading Vue assets from Webpack web server in development
|
79
|
+
|
80
|
+
<% = javascript_include_tag *webpack_asset_paths('application') %>
|
81
|
+
|
82
|
+
2. Now add your own Vue components to webpack/components/<your_component>,
|
83
|
+
require your component from webpack/components/index.js
|
84
|
+
|
85
|
+
MESSAGE
|
86
|
+
end
|
87
|
+
|
71
88
|
no_tasks do
|
72
89
|
def install_npm_packanges(type, *packages)
|
73
90
|
run "npm i #{packages.join(' ')} #{type}"
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
var Vue = require('vue')
|
2
|
+
Vue.use(require('vue-resource'))
|
3
|
+
|
4
|
+
// Vue.http.options.root = '/api';
|
5
|
+
Vue.http.interceptors.push({
|
6
|
+
request: function (request) {
|
7
|
+
Vue.http.headers.common['X-CSRF-Token'] = $('[name="csrf-token"]').attr('content');
|
8
|
+
return request;
|
9
|
+
},
|
10
|
+
response: function (response) {
|
11
|
+
return response;
|
12
|
+
}
|
13
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
require('./http');
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vuejs-webpack-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xiaohui Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -61,7 +61,12 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- lib/generators/vuejs_webpack_rails/install_generator.rb
|
64
|
-
- lib/generators/vuejs_webpack_rails/templates/vue.config.js
|
64
|
+
- lib/generators/vuejs_webpack_rails/templates/config/vue.config.js
|
65
|
+
- lib/generators/vuejs_webpack_rails/templates/webpack/application.js
|
66
|
+
- lib/generators/vuejs_webpack_rails/templates/webpack/components/hello/index.vue
|
67
|
+
- lib/generators/vuejs_webpack_rails/templates/webpack/components/index.js
|
68
|
+
- lib/generators/vuejs_webpack_rails/templates/webpack/concerns/http.js
|
69
|
+
- lib/generators/vuejs_webpack_rails/templates/webpack/concerns/index.js
|
65
70
|
- lib/vuejs-webpack-rails.rb
|
66
71
|
- lib/vuejs/webpack/rails.rb
|
67
72
|
- lib/vuejs/webpack/rails/version.rb
|