sprockets-webpack 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a3f733b0cd88fa8a9f0927ae30f601c8f2dc101
|
4
|
+
data.tar.gz: b646f9d86b232ad700e09a56ca6bf49b15789bdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39e2adab8890f391106cf86d61f54d269f0b826fe4fcdaed17926dea8b00906cec35338f70ad689bce9dee27cde393931cfa1b0a70aa40957b1939b0caedf7b6
|
7
|
+
data.tar.gz: a5e9d9019fead8a9c98b35cdc1c2daef8354702d0855e7a2878c6e27e5d237b71667e436b5430554fc5e0ba8f84a42d15c35bd81f7f590600dd7c6a1811d13fe
|
@@ -1,6 +1,11 @@
|
|
1
1
|
// Your package.json should include related packages
|
2
2
|
// Remember to run npm install before starting Rails app
|
3
|
+
|
4
|
+
var webpack = require('webpack');
|
5
|
+
|
3
6
|
var config = {
|
7
|
+
// entry: ..... <--- ignored, will default to app/assets/webpack/index.js
|
8
|
+
// output: ... <--- ignored, the output will be sent through Sprockets pipeline
|
4
9
|
module: {
|
5
10
|
loaders: [
|
6
11
|
{
|
@@ -8,7 +13,7 @@ var config = {
|
|
8
13
|
exclude: /(node_modules|bower_components)/,
|
9
14
|
loader: 'babel',
|
10
15
|
query: {
|
11
|
-
presets: ['es2015'
|
16
|
+
presets: ['es2015']
|
12
17
|
}
|
13
18
|
}
|
14
19
|
]
|
@@ -21,7 +21,8 @@ module Sprockets
|
|
21
21
|
|
22
22
|
def _call(_)
|
23
23
|
result = super
|
24
|
-
|
24
|
+
joined_data = [result[:data], "\n\n\n", @webpack_data].compact.join
|
25
|
+
result.merge(data: joined_data)
|
25
26
|
end
|
26
27
|
|
27
28
|
private
|
@@ -55,8 +56,8 @@ module Sprockets
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def require_webpack_paths(paths, deps)
|
58
|
-
|
59
|
-
|
59
|
+
paths.each.map(&:first).each do |path|
|
60
|
+
@dependencies << "file-digest://#{path}"
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|