webpacker 3.0.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintignore +1 -0
- data/.travis.yml +10 -0
- data/CHANGELOG.md +110 -0
- data/Gemfile.lock +69 -67
- data/MIT-LICENSE +1 -1
- data/README.md +86 -30
- data/docs/assets.md +4 -4
- data/docs/cloud9.md +310 -0
- data/docs/css.md +32 -3
- data/docs/deployment.md +42 -4
- data/docs/docker.md +49 -0
- data/docs/env.md +5 -5
- data/docs/folder-structure.md +2 -2
- data/docs/testing.md +14 -34
- data/docs/troubleshooting.md +40 -4
- data/docs/typescript.md +2 -2
- data/docs/webpack-dev-server.md +21 -4
- data/docs/webpack.md +103 -25
- data/gemfiles/Gemfile-rails-edge +13 -0
- data/gemfiles/Gemfile-rails.4.2.x +10 -0
- data/gemfiles/Gemfile-rails.5.0.x +10 -0
- data/gemfiles/Gemfile-rails.5.1.x +10 -0
- data/lib/install/angular.rb +5 -5
- data/lib/install/config/webpacker.yml +7 -0
- data/lib/install/elm.rb +7 -7
- data/lib/install/examples/vue/hello_vue.js +30 -4
- data/lib/install/react.rb +5 -5
- data/lib/install/template.rb +19 -9
- data/lib/install/vue.rb +4 -4
- data/lib/tasks/installers.rake +2 -2
- data/lib/tasks/webpacker.rake +7 -6
- data/lib/tasks/webpacker/check_binstubs.rake +3 -3
- data/lib/tasks/webpacker/compile.rake +15 -8
- data/lib/tasks/webpacker/install.rake +4 -4
- data/lib/tasks/webpacker/verify_install.rake +1 -1
- data/lib/webpacker/compiler.rb +6 -6
- data/lib/webpacker/dev_server.rb +2 -2
- data/lib/webpacker/dev_server_proxy.rb +2 -1
- data/lib/webpacker/dev_server_runner.rb +4 -4
- data/lib/webpacker/helper.rb +3 -3
- data/lib/webpacker/manifest.rb +2 -2
- data/lib/webpacker/railtie.rb +41 -2
- data/lib/webpacker/runner.rb +1 -1
- data/lib/webpacker/version.rb +1 -1
- data/package.json +29 -21
- data/package/asset_host.js +4 -5
- data/package/config.js +7 -1
- data/package/config_types/__tests__/config_list.js +123 -0
- data/package/config_types/__tests__/config_object.js +43 -0
- data/package/config_types/config_list.js +83 -0
- data/package/config_types/config_object.js +55 -0
- data/package/config_types/index.js +7 -0
- data/package/environment.js +64 -40
- data/package/environments/development.js +31 -34
- data/package/environments/production.js +14 -11
- data/package/index.js +7 -2
- data/package/{loaders → rules}/babel.js +6 -4
- data/package/{loaders → rules}/coffee.js +3 -1
- data/package/rules/css.js +39 -0
- data/package/rules/elm.js +23 -0
- data/package/rules/erb.js +11 -0
- data/package/{loaders → rules}/file.js +1 -1
- data/package/rules/index.js +23 -0
- data/package/rules/sass.js +15 -0
- data/package/{loaders → rules}/typescript.js +3 -1
- data/package/rules/url.js +13 -0
- data/package/rules/vue.js +13 -0
- data/package/utils/__tests__/deep_assign.js +11 -0
- data/package/utils/__tests__/deep_merge.js +10 -0
- data/package/utils/__tests__/objectify.js +9 -0
- data/package/utils/deep_assign.js +22 -0
- data/package/utils/deep_merge.js +23 -0
- data/package/utils/helpers.js +32 -0
- data/package/utils/objectify.js +4 -0
- data/test/command_test.rb +1 -1
- data/test/compiler_test.rb +5 -1
- data/test/configuration_test.rb +1 -1
- data/test/dev_server_test.rb +1 -1
- data/test/helper_test.rb +15 -10
- data/test/manifest_test.rb +1 -1
- data/test/rake_tasks_test.rb +29 -0
- data/test/test_app/Rakefile +3 -0
- data/test/test_app/config/application.rb +11 -0
- data/test/test_app/config/environment.rb +4 -0
- data/test/{webpacker_test_helper.rb → test_helper.rb} +3 -14
- data/webpacker.gemspec +1 -1
- data/yarn.lock +1552 -829
- metadata +43 -16
- data/package/loaders/elm.js +0 -19
- data/package/loaders/erb.js +0 -9
- data/package/loaders/style.js +0 -31
- data/package/loaders/vue.js +0 -12
- data/test/test_app/config/secrets.yml +0 -5
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpacker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -89,8 +89,10 @@ files:
|
|
89
89
|
- README.md
|
90
90
|
- Rakefile
|
91
91
|
- docs/assets.md
|
92
|
+
- docs/cloud9.md
|
92
93
|
- docs/css.md
|
93
94
|
- docs/deployment.md
|
95
|
+
- docs/docker.md
|
94
96
|
- docs/env.md
|
95
97
|
- docs/es6.md
|
96
98
|
- docs/folder-structure.md
|
@@ -104,6 +106,10 @@ files:
|
|
104
106
|
- docs/yarn.md
|
105
107
|
- exe/webpack
|
106
108
|
- exe/webpack-dev-server
|
109
|
+
- gemfiles/Gemfile-rails-edge
|
110
|
+
- gemfiles/Gemfile-rails.4.2.x
|
111
|
+
- gemfiles/Gemfile-rails.5.0.x
|
112
|
+
- gemfiles/Gemfile-rails.5.1.x
|
107
113
|
- lib/install/angular.rb
|
108
114
|
- lib/install/config/.babelrc
|
109
115
|
- lib/install/config/.postcssrc.yml
|
@@ -156,28 +162,46 @@ files:
|
|
156
162
|
- package.json
|
157
163
|
- package/asset_host.js
|
158
164
|
- package/config.js
|
165
|
+
- package/config_types/__tests__/config_list.js
|
166
|
+
- package/config_types/__tests__/config_object.js
|
167
|
+
- package/config_types/config_list.js
|
168
|
+
- package/config_types/config_object.js
|
169
|
+
- package/config_types/index.js
|
159
170
|
- package/environment.js
|
160
171
|
- package/environments/development.js
|
161
172
|
- package/environments/production.js
|
162
173
|
- package/environments/test.js
|
163
174
|
- package/index.js
|
164
|
-
- package/
|
165
|
-
- package/
|
166
|
-
- package/
|
167
|
-
- package/
|
168
|
-
- package/
|
169
|
-
- package/
|
170
|
-
- package/
|
171
|
-
- package/
|
175
|
+
- package/rules/babel.js
|
176
|
+
- package/rules/coffee.js
|
177
|
+
- package/rules/css.js
|
178
|
+
- package/rules/elm.js
|
179
|
+
- package/rules/erb.js
|
180
|
+
- package/rules/file.js
|
181
|
+
- package/rules/index.js
|
182
|
+
- package/rules/sass.js
|
183
|
+
- package/rules/typescript.js
|
184
|
+
- package/rules/url.js
|
185
|
+
- package/rules/vue.js
|
186
|
+
- package/utils/__tests__/deep_assign.js
|
187
|
+
- package/utils/__tests__/deep_merge.js
|
188
|
+
- package/utils/__tests__/objectify.js
|
189
|
+
- package/utils/deep_assign.js
|
190
|
+
- package/utils/deep_merge.js
|
191
|
+
- package/utils/helpers.js
|
192
|
+
- package/utils/objectify.js
|
172
193
|
- test/command_test.rb
|
173
194
|
- test/compiler_test.rb
|
174
195
|
- test/configuration_test.rb
|
175
196
|
- test/dev_server_test.rb
|
176
197
|
- test/helper_test.rb
|
177
198
|
- test/manifest_test.rb
|
178
|
-
- test/
|
199
|
+
- test/rake_tasks_test.rb
|
200
|
+
- test/test_app/Rakefile
|
201
|
+
- test/test_app/config/application.rb
|
202
|
+
- test/test_app/config/environment.rb
|
179
203
|
- test/test_app/public/packs/manifest.json
|
180
|
-
- test/
|
204
|
+
- test/test_helper.rb
|
181
205
|
- webpacker.gemspec
|
182
206
|
- yarn.lock
|
183
207
|
homepage: https://github.com/rails/webpacker
|
@@ -200,10 +224,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
224
|
version: '0'
|
201
225
|
requirements: []
|
202
226
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.
|
227
|
+
rubygems_version: 2.6.11
|
204
228
|
signing_key:
|
205
229
|
specification_version: 4
|
206
|
-
summary: Use
|
230
|
+
summary: Use webpack to manage app-like JavaScript modules in Rails
|
207
231
|
test_files:
|
208
232
|
- test/command_test.rb
|
209
233
|
- test/compiler_test.rb
|
@@ -211,6 +235,9 @@ test_files:
|
|
211
235
|
- test/dev_server_test.rb
|
212
236
|
- test/helper_test.rb
|
213
237
|
- test/manifest_test.rb
|
214
|
-
- test/
|
238
|
+
- test/rake_tasks_test.rb
|
239
|
+
- test/test_app/Rakefile
|
240
|
+
- test/test_app/config/application.rb
|
241
|
+
- test/test_app/config/environment.rb
|
215
242
|
- test/test_app/public/packs/manifest.json
|
216
|
-
- test/
|
243
|
+
- test/test_helper.rb
|
data/package/loaders/elm.js
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
const { resolve } = require('path')
|
2
|
-
|
3
|
-
const elmSource = resolve(process.cwd())
|
4
|
-
const elmMake = `${elmSource}/node_modules/.bin/elm-make`
|
5
|
-
const elmDefaultOptions = `cwd=${elmSource}&pathToMake=${elmMake}`
|
6
|
-
|
7
|
-
const loaderOptions = () => {
|
8
|
-
if (process.env.NODE_ENV === 'production') {
|
9
|
-
return `elm-webpack-loader?${elmDefaultOptions}`
|
10
|
-
}
|
11
|
-
|
12
|
-
return `elm-hot-loader!elm-webpack-loader?${elmDefaultOptions}&verbose=true&warn=true&debug=true`
|
13
|
-
}
|
14
|
-
|
15
|
-
module.exports = {
|
16
|
-
test: /\.elm(\.erb)?$/,
|
17
|
-
exclude: [/elm-stuff/, /node_modules/],
|
18
|
-
loader: loaderOptions()
|
19
|
-
}
|
data/package/loaders/erb.js
DELETED
data/package/loaders/style.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
2
|
-
const path = require('path')
|
3
|
-
const { dev_server: devServer } = require('../config')
|
4
|
-
|
5
|
-
const postcssConfigPath = path.resolve(process.cwd(), '.postcssrc.yml')
|
6
|
-
const isProduction = process.env.NODE_ENV === 'production'
|
7
|
-
const extractCSS = !(devServer && devServer.hmr)
|
8
|
-
|
9
|
-
const extractOptions = {
|
10
|
-
fallback: 'style-loader',
|
11
|
-
use: [
|
12
|
-
{ loader: 'css-loader', options: { minimize: isProduction } },
|
13
|
-
{ loader: 'postcss-loader', options: { sourceMap: true, config: { path: postcssConfigPath } } },
|
14
|
-
'resolve-url-loader',
|
15
|
-
{ loader: 'sass-loader', options: { sourceMap: true } }
|
16
|
-
]
|
17
|
-
}
|
18
|
-
|
19
|
-
// For production extract styles to a separate bundle
|
20
|
-
const extractCSSLoader = {
|
21
|
-
test: /\.(scss|sass|css)$/i,
|
22
|
-
use: ExtractTextPlugin.extract(extractOptions)
|
23
|
-
}
|
24
|
-
|
25
|
-
// For hot-reloading use regular loaders
|
26
|
-
const inlineCSSLoader = {
|
27
|
-
test: /\.(scss|sass|css)$/i,
|
28
|
-
use: ['style-loader'].concat(extractOptions.use)
|
29
|
-
}
|
30
|
-
|
31
|
-
module.exports = isProduction || extractCSS ? extractCSSLoader : inlineCSSLoader
|
data/package/loaders/vue.js
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
const { dev_server: devServer } = require('../config')
|
2
|
-
|
3
|
-
const isProduction = process.env.NODE_ENV === 'production'
|
4
|
-
const extractCSS = !(devServer && devServer.hmr)
|
5
|
-
|
6
|
-
module.exports = {
|
7
|
-
test: /\.vue(\.erb)?$/,
|
8
|
-
loader: 'vue-loader',
|
9
|
-
options: {
|
10
|
-
extractCSS: isProduction || extractCSS
|
11
|
-
}
|
12
|
-
}
|