webpack_assets 0.0.4 → 0.0.5
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/README.md +11 -0
- data/lib/webpack_assets/tasks/webpack.rake +11 -10
- data/lib/webpack_assets/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81dac1a837b2c2b8f94db605edc4e35946d23571
|
4
|
+
data.tar.gz: 9c43014ea55883f74da6c78b95a4113f8d5fdc05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb09c656212347dd9c33dfd77e34c5ad5443137ee592bb7cb8da205866b1cefbb81f2e0ae0142d3bbbd6f5679a86b6c19654440e9b56762dcb0f8b6a6ce1158a
|
7
|
+
data.tar.gz: 3d17e30e7a6dd7ffd809792e7220d80cb43456e0c38dce48f76b89ee3ce5d40c77a66466c01ba0b00246fb7a0a438aa39d37a46aabcc473034deda1e43ac8b88
|
data/README.md
CHANGED
@@ -29,6 +29,17 @@ name, update your `config/application.rb` file:
|
|
29
29
|
config.webpack_build_path = 'app/assets/javascripts/your-js-file.js'
|
30
30
|
````
|
31
31
|
|
32
|
+
For multiple files an array may be used:
|
33
|
+
|
34
|
+
````ruby
|
35
|
+
# config/application.rb
|
36
|
+
config.webpack_build_path = [
|
37
|
+
'app/assets/javascripts/your-js-file1.js',
|
38
|
+
'app/assets/javascripts/your-js-file2.js',
|
39
|
+
'app/assets/javascripts/your-js-file3.js'
|
40
|
+
]
|
41
|
+
````
|
42
|
+
|
32
43
|
Including the gem will automatically inject the webpack build into the
|
33
44
|
precompilation of assets. To run your webpack build manually execute:
|
34
45
|
|
@@ -18,21 +18,22 @@ namespace :assets do
|
|
18
18
|
sh "NODE_ENV=#{Rails.env} $(npm bin)/webpack"
|
19
19
|
end
|
20
20
|
|
21
|
-
# look up the file to clobber, or fallback to default
|
22
|
-
task :clobber do
|
23
|
-
path = begin
|
24
|
-
"#{Rails.root}/#{Rails.application.config.webpack_build_path}"
|
25
|
-
rescue
|
26
|
-
"#{Rails.root}/app/assets/javascripts/bundle.js"
|
27
|
-
end
|
28
|
-
rm_rf path
|
29
|
-
end
|
30
|
-
|
31
21
|
namespace :webpack do
|
32
22
|
desc 'compile with webpack and watch for changes'
|
33
23
|
task :watch do
|
34
24
|
sh "NODE_ENV=#{Rails.env} $(npm bin)/webpack --config webpack.config.js --colors --progress --watch --devtool inline-source-map"
|
35
25
|
end
|
26
|
+
|
27
|
+
# look up the file to clobber, or fallback to default
|
28
|
+
task :clobber do
|
29
|
+
path = begin
|
30
|
+
[Rails.application.config.webpack_build_path].flatten.map { |path| "#{Rails.root}/#{path}" }
|
31
|
+
rescue
|
32
|
+
"#{Rails.root}/app/assets/javascripts/bundle.js"
|
33
|
+
end
|
34
|
+
rm_rf path
|
35
|
+
end
|
36
|
+
|
36
37
|
end
|
37
38
|
|
38
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpack_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Madsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,4 +83,3 @@ signing_key:
|
|
83
83
|
specification_version: 4
|
84
84
|
summary: add webpack build into assets:precompile
|
85
85
|
test_files: []
|
86
|
-
has_rdoc:
|