webpack_native 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/webpack_native/dev_generator.rb +1 -0
- data/lib/generators/webpack_native/templates/webpack_native/src/javascripts/application.js +1 -0
- data/lib/generators/webpack_native/templates/webpack_native/webpack.config.js +22 -1
- data/lib/webpack_native/version.rb +1 -1
- data/lib/webpack_native/webpack_native_helper.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3502e8e87605dd20dea5b8c8509eb8ed95269e5bb0bee23f74c16b0500b988c
|
4
|
+
data.tar.gz: 9586d22e15d5e78f695df50da43c12d6849459e26cc1ead5e1eabfa86f07ef54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4b7aa7fe8d78cd9968ae67080e9ec5063b54a6f4edde532d673a5cc8d84ec1cc3508874f0fa145d7852e5db6f81aead923bbcbf15e9f258afc2fd20f189b1c1
|
7
|
+
data.tar.gz: 013a76ebae4470190a87d83c864bdb646f1dcc490527c50249a5695f8f6c33d010a6ec8803c236ff3b53b712cfc15b90ad0f1dcca398bfbca5898b2bf53b67eb
|
@@ -7,6 +7,7 @@ class WebpackNative::DevGenerator < Rails::Generators::Base
|
|
7
7
|
Mutex.new.synchronize do
|
8
8
|
Dir.chdir "#{Rails.root}/app/webpack_native" do
|
9
9
|
Dir.mkdir('src/images') unless Dir.exist?('src/images')
|
10
|
+
Dir.mkdir('src/favicons') unless Dir.exist?('src/favicons')
|
10
11
|
%x{ yarn install }
|
11
12
|
result = %x{ npm run build:dev }
|
12
13
|
puts "\n"
|
@@ -2,6 +2,7 @@
|
|
2
2
|
import '../stylesheets/application.scss';
|
3
3
|
// the following line requires that images folder exists
|
4
4
|
require.context('../images', true, /\.(gif|jpeg|jpg|png|svg)$/i);
|
5
|
+
require.context('../favicons', true);
|
5
6
|
|
6
7
|
require("@rails/ujs").start();
|
7
8
|
require("turbolinks").start();
|
@@ -57,7 +57,10 @@ module.exports = (env, options) => {
|
|
57
57
|
],
|
58
58
|
},
|
59
59
|
{
|
60
|
-
test: /\.(png|jpg|jpeg|gif|svg|ttf|woff2|woff|eot
|
60
|
+
test: /\.(png|jpg|jpeg|gif|svg|ttf|woff2|woff|eot)$/i,
|
61
|
+
exclude: [
|
62
|
+
path.resolve(__dirname, "src/favicons")
|
63
|
+
],
|
61
64
|
use: [
|
62
65
|
{
|
63
66
|
loader: 'url-loader',
|
@@ -68,6 +71,24 @@ module.exports = (env, options) => {
|
|
68
71
|
},
|
69
72
|
// { loader: 'image-webpack-loader' }
|
70
73
|
],
|
74
|
+
},
|
75
|
+
{
|
76
|
+
test: /\.(png|jpg|jpeg|svg|ttf|ico|webmanifest)$/i,
|
77
|
+
exclude: [
|
78
|
+
path.resolve(__dirname, "src/images"),
|
79
|
+
path.resolve(__dirname, 'node_modules')
|
80
|
+
],
|
81
|
+
use: [
|
82
|
+
{
|
83
|
+
loader: 'url-loader',
|
84
|
+
options: {
|
85
|
+
limit: false, //8192,
|
86
|
+
name: '[name].[ext]',
|
87
|
+
outputPath: '../../public'
|
88
|
+
},
|
89
|
+
},
|
90
|
+
// { loader: 'image-webpack-loader' }
|
91
|
+
],
|
71
92
|
}
|
72
93
|
]
|
73
94
|
},
|
@@ -50,10 +50,10 @@ module WebpackNative::WebpackNativeHelper
|
|
50
50
|
# <%= webpack_webmanifest('manifest.webmanifest') %>
|
51
51
|
|
52
52
|
# result:
|
53
|
-
#<link rel="apple-touch-icon" sizes="180x180" href="/
|
54
|
-
#<link rel="icon" type="image/png" sizes="32x32" href="/
|
55
|
-
#<link rel="icon" type="image/png" sizes="16x16" href="/
|
56
|
-
#<link rel="manifest" href="/
|
53
|
+
#<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
54
|
+
#<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
55
|
+
#<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
56
|
+
#<link rel="manifest" href="/site.webmanifest">
|
57
57
|
|
58
58
|
def webpack_favicons(*args)
|
59
59
|
tags = []
|
@@ -66,7 +66,7 @@ module WebpackNative::WebpackNativeHelper
|
|
66
66
|
manifest = favicon
|
67
67
|
html_options = {
|
68
68
|
rel: 'manifest',
|
69
|
-
href:
|
69
|
+
href: manifest
|
70
70
|
}
|
71
71
|
|
72
72
|
else
|
@@ -83,7 +83,7 @@ module WebpackNative::WebpackNativeHelper
|
|
83
83
|
html_options = {
|
84
84
|
rel: filename == 'apple-touch-icon' ? 'apple-touch-icon' : 'icon',
|
85
85
|
type: mimetypes[ext],
|
86
|
-
href:
|
86
|
+
href: favicon
|
87
87
|
}
|
88
88
|
|
89
89
|
sizes = filename[/(.+)?([0-9]{2,3}x[0-9]{2,3})(.+)?/, 2]
|