middleman-webpacked 0.0.3 → 0.1.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4776674433ae384fafefe389f29a2a08a2e642d8
|
4
|
+
data.tar.gz: c1bc53ff2723b4fc003c09521403add3473365e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ababe16933dda3049f193a110b5a91bfea4735a5a657081a842d5ad357c0a3767865ea70d33e6f7a7807b4b217f5a07c2a64a2c618b1e5fcd6b2c66eff8b762
|
7
|
+
data.tar.gz: b0903fb18f5e00435d7cfb9b6ab7c579dca1bcf16d32186069cbdf8dc753fc783e0d9bb98983989dc247fc4232ca1b74b5cdafd744d0da475f3b6ef46aa52bb5
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Middleman Webpacked
|
|
6
6
|
Add this line to your `Gemfile`
|
7
7
|
|
8
8
|
```ruby
|
9
|
-
gem 'middleman-webpacked', '~> 0.0
|
9
|
+
gem 'middleman-webpacked', '~> 0.1.0'
|
10
10
|
```
|
11
11
|
|
12
12
|
Setup your Webpack
|
@@ -16,6 +16,7 @@ middleman webpack
|
|
16
16
|
```
|
17
17
|
|
18
18
|
> To enable React.js, add `--react` options when setup Webpack
|
19
|
+
> To enable Vue.js, add `--vue` options when setup Webpack
|
19
20
|
|
20
21
|
Add `javascript_pack_tag` to your layout
|
21
22
|
|
@@ -53,5 +54,10 @@ activate :webpack,
|
|
53
54
|
* [ ] Automatic setup `webpack.config.js`
|
54
55
|
* [x] Babel Support
|
55
56
|
* [x] React.js Support
|
57
|
+
* [x] Can be enabled
|
58
|
+
* [ ] Support to generate css file
|
56
59
|
* [ ] Vue.js Support
|
60
|
+
* [x] Can be enabled
|
61
|
+
* [x] Support template and `.vue` file
|
62
|
+
* [ ] Support to generate css file
|
57
63
|
* [ ] Sass Support
|
@@ -17,6 +17,11 @@ module Middleman
|
|
17
17
|
default: false,
|
18
18
|
desc: 'Add react support'
|
19
19
|
|
20
|
+
class_option 'vue',
|
21
|
+
type: :boolean,
|
22
|
+
default: false,
|
23
|
+
desc: 'Add vue support'
|
24
|
+
|
20
25
|
def self.source_root
|
21
26
|
File.expand_path('../../template', __FILE__)
|
22
27
|
end
|
@@ -36,9 +41,11 @@ module Middleman
|
|
36
41
|
|
37
42
|
def webpack
|
38
43
|
@presets = ['env']
|
44
|
+
@plugins = []
|
39
45
|
@loaders = []
|
40
46
|
|
41
47
|
enable_react if options[:react]
|
48
|
+
enable_vue if options[:vue]
|
42
49
|
|
43
50
|
generate_config
|
44
51
|
run "yarn add #{@packages.join(' ')} --dev"
|
@@ -65,6 +72,23 @@ module Middleman
|
|
65
72
|
})
|
66
73
|
end
|
67
74
|
|
75
|
+
def enable_vue
|
76
|
+
@packages.push(
|
77
|
+
'vue',
|
78
|
+
'babel-preset-es2015',
|
79
|
+
'vue-loader',
|
80
|
+
'vue-template-compiler'
|
81
|
+
)
|
82
|
+
@presets = ['env', 'es2015']
|
83
|
+
@loaders.push({
|
84
|
+
test: /\.vue$/,
|
85
|
+
use: 'vue-loader',
|
86
|
+
},{
|
87
|
+
test: /\.js$/,
|
88
|
+
use: 'babel-loader'
|
89
|
+
})
|
90
|
+
end
|
91
|
+
|
68
92
|
# Add to CLI
|
69
93
|
Base.register( self, 'webpack', 'webpack [options]', 'Install webpack to middleman')
|
70
94
|
|
@@ -1,12 +1,17 @@
|
|
1
|
+
<% if options[:vue] %>const { VueLoaderPlugin } = require('vue-loader')<% end %>
|
2
|
+
|
1
3
|
module.exports = {
|
2
4
|
module: {
|
3
5
|
rules: [
|
4
|
-
<%- @loaders.
|
6
|
+
<%- @loaders.each_with_index do |loader, index| %>
|
5
7
|
{
|
6
8
|
test: <%= loader[:test].inspect %>,
|
7
|
-
use: "<%= loader[:use] %>"
|
8
|
-
}
|
9
|
-
<% end
|
9
|
+
use: "<%= loader[:use] %>",
|
10
|
+
},
|
11
|
+
<% end %>
|
10
12
|
]
|
11
|
-
}
|
13
|
+
},
|
14
|
+
plugins: [
|
15
|
+
<% if options[:vue] %>new VueLoaderPlugin(),<% end %>
|
16
|
+
]
|
12
17
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-webpacked
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aotokitsuruya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|