webpacker 3.6.0 → 4.0.0.pre.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -3
- data/CHANGELOG.md +6 -43
- data/Gemfile.lock +48 -58
- data/README.md +11 -11
- data/Rakefile +2 -1
- data/docs/cloud9.md +1 -1
- data/docs/css.md +0 -10
- data/docs/troubleshooting.md +2 -2
- data/lib/install/angular.rb +2 -2
- data/lib/install/bin/webpack +1 -1
- data/lib/install/bin/webpack-dev-server +1 -1
- data/lib/install/config/webpacker.yml +1 -2
- data/lib/install/elm.rb +3 -4
- data/lib/install/examples/elm/Main.elm +4 -5
- data/lib/install/examples/elm/hello_elm.js +2 -6
- data/lib/install/examples/vue/hello_vue.js +1 -1
- data/lib/install/loaders/elm.js +4 -3
- data/lib/install/loaders/vue.js +1 -3
- data/lib/install/template.rb +3 -3
- data/lib/install/typescript.rb +1 -1
- data/lib/install/vue.rb +13 -4
- data/lib/tasks/webpacker.rake +0 -1
- data/lib/tasks/webpacker/yarn_install.rake +1 -1
- data/lib/webpacker.rb +0 -1
- data/lib/webpacker/compiler.rb +2 -4
- data/lib/webpacker/configuration.rb +3 -13
- data/lib/webpacker/dev_server.rb +4 -8
- data/lib/webpacker/dev_server_proxy.rb +0 -4
- data/lib/webpacker/dev_server_runner.rb +7 -15
- data/lib/webpacker/env.rb +1 -1
- data/lib/webpacker/helper.rb +0 -10
- data/lib/webpacker/instance.rb +2 -6
- data/lib/webpacker/railtie.rb +1 -2
- data/lib/webpacker/version.rb +1 -1
- data/package.json +16 -16
- data/package/__tests__/config.js +1 -17
- data/package/__tests__/production.js +1 -3
- data/package/__tests__/staging.js +1 -3
- data/package/__tests__/test.js +1 -3
- data/package/config.js +1 -9
- data/package/dev_server.js +1 -1
- data/package/env.js +2 -2
- data/package/environments/base.js +22 -5
- data/package/environments/development.js +2 -0
- data/package/environments/production.js +26 -36
- data/package/utils/__tests__/deep_assign.js +6 -27
- data/package/utils/deep_assign.js +1 -1
- data/package/utils/get_style_rule.js +26 -37
- data/test/configuration_test.rb +22 -46
- data/test/helper_test.rb +0 -6
- data/test/test_app/config/webpacker.yml +0 -1
- data/test/test_helper.rb +0 -2
- data/webpacker.gemspec +0 -5
- data/yarn.lock +2199 -998
- metadata +6 -11
- data/lib/tasks/webpacker/info.rake +0 -19
- data/test/webpacker_test.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ce86b1030177d36c96b211f3c3a939714b05dfc7ca09f7e9355ad677d6657bc
|
4
|
+
data.tar.gz: 209c6ae1d4fc283cda9bf8270c4edc6c614020eb92484b6d8a248c7f98a26862
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f1b984c69ab267777ba8efc7a4d24f6746c4e3e0eab42e285ea5f593730c8041a027c09f44e26644dcb8acbcd7caf10e916d1226043b01a7f573f488318ecfc
|
7
|
+
data.tar.gz: 65c10dd913612c8d027322c5b95d45921b36dad09d1928df4008784ab7f1a960dea1500bb97201e572bc8a380378d6ac8b0131327451aecbafef3f5f8ec54fe5
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,52 +1,15 @@
|
|
1
1
|
**Please note that Webpacker 3.1.0 and 3.1.1 have some serious bugs so please consider using either 3.0.2 or 3.2.0**
|
2
2
|
|
3
|
-
## [
|
4
|
-
See changes: https://github.com/rails/webpacker/compare/88a253ed42966eb2d5c997435e9396881513bce1...3-x-stable
|
3
|
+
## [4.0.0-pre.1] - 2018-04-2
|
5
4
|
|
5
|
+
Pre-release to try out webpack 4.0 support
|
6
6
|
|
7
|
-
##
|
8
|
-
|
9
|
-
|
10
|
-
### Added
|
11
|
-
- On CI, sort files & check modified w/ digest intead of mtime[#1522](https://github.com/rails/webpacker/pull/1522)
|
12
|
-
|
13
|
-
|
14
|
-
## [3.5.3] - 2018-05-03
|
15
|
-
|
16
|
-
### Fixed
|
17
|
-
- Relax Javascript package dependencies [#1466](https://github.com/rails/webpacker/pull/1466#issuecomment-386336605)
|
18
|
-
|
19
|
-
|
20
|
-
## [3.5.2] - 2018-04-29
|
21
|
-
|
22
|
-
- Pin Javascript package to 3.5.x
|
23
|
-
|
24
|
-
|
25
|
-
## [3.5.1] - 2018-04-29
|
26
|
-
|
27
|
-
- Upgraded gems and Javascript packages
|
28
|
-
|
29
|
-
|
30
|
-
## [3.5.0] - 2018-04-29
|
31
|
-
|
32
|
-
### Fixed
|
33
|
-
- Remove compilation digest file if webpack command fails [#1399](https://github.com/rails/webpacker/pull/1399)
|
34
|
-
- Handle http dev_server setting properly in the proxy [#1420](https://github.com/rails/webpacker/pull/1420)
|
35
|
-
- Use correct protocol [#1425](https://github.com/rails/webpacker/pull/1425)
|
36
|
-
|
37
|
-
### Added
|
38
|
-
- `image_pack_tag` helper [#1400](https://github.com/rails/webpacker/pull/1400)
|
39
|
-
- devserver proxy for custom environments [#1415](https://github.com/rails/webpacker/pull/1415)
|
40
|
-
- Rails webpacker:info task [#1416](https://github.com/rails/webpacker/pull/1416)
|
41
|
-
- Include `RAILS_RELATIVE_URL_ROOT` environment variable in publicPath [#1428](https://github.com/rails/webpacker/pull/1428)
|
42
|
-
|
43
|
-
Complete list of changes: [#1464](https://github.com/rails/webpacker/pull/1464)
|
44
|
-
|
7
|
+
## Added
|
8
|
+
- Webpack 4.0 support [#1376](https://github.com/rails/webpacker/pull/1316)
|
45
9
|
|
46
|
-
##
|
10
|
+
## Fixed
|
11
|
+
- Remove compilation digest file if webpack command fails[#1398](https://github.com/rails/webpacker/issues/1398)
|
47
12
|
|
48
|
-
### Fixed
|
49
|
-
- Lock webpacker version in installer [#1401](https://github.com/rails/webpacker/issues/1401)
|
50
13
|
|
51
14
|
## [3.4.1] - 2018-03-24
|
52
15
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
webpacker (
|
4
|
+
webpacker (4.0.0.pre.pre.1)
|
5
5
|
activesupport (>= 4.2)
|
6
6
|
rack-proxy (>= 0.6.1)
|
7
7
|
railties (>= 4.2)
|
@@ -9,111 +9,101 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actioncable (5.
|
13
|
-
actionpack (= 5.
|
12
|
+
actioncable (5.1.6)
|
13
|
+
actionpack (= 5.1.6)
|
14
14
|
nio4r (~> 2.0)
|
15
|
-
websocket-driver (
|
16
|
-
actionmailer (5.
|
17
|
-
actionpack (= 5.
|
18
|
-
actionview (= 5.
|
19
|
-
activejob (= 5.
|
15
|
+
websocket-driver (~> 0.6.1)
|
16
|
+
actionmailer (5.1.6)
|
17
|
+
actionpack (= 5.1.6)
|
18
|
+
actionview (= 5.1.6)
|
19
|
+
activejob (= 5.1.6)
|
20
20
|
mail (~> 2.5, >= 2.5.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
|
-
actionpack (5.
|
23
|
-
actionview (= 5.
|
24
|
-
activesupport (= 5.
|
22
|
+
actionpack (5.1.6)
|
23
|
+
actionview (= 5.1.6)
|
24
|
+
activesupport (= 5.1.6)
|
25
25
|
rack (~> 2.0)
|
26
26
|
rack-test (>= 0.6.3)
|
27
27
|
rails-dom-testing (~> 2.0)
|
28
28
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
29
|
-
actionview (5.
|
30
|
-
activesupport (= 5.
|
29
|
+
actionview (5.1.6)
|
30
|
+
activesupport (= 5.1.6)
|
31
31
|
builder (~> 3.1)
|
32
32
|
erubi (~> 1.4)
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
34
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
35
|
-
activejob (5.
|
36
|
-
activesupport (= 5.
|
35
|
+
activejob (5.1.6)
|
36
|
+
activesupport (= 5.1.6)
|
37
37
|
globalid (>= 0.3.6)
|
38
|
-
activemodel (5.
|
39
|
-
activesupport (= 5.
|
40
|
-
activerecord (5.
|
41
|
-
activemodel (= 5.
|
42
|
-
activesupport (= 5.
|
43
|
-
arel (
|
44
|
-
|
45
|
-
actionpack (= 5.2.0)
|
46
|
-
activerecord (= 5.2.0)
|
47
|
-
marcel (~> 0.3.1)
|
48
|
-
activesupport (5.2.0)
|
38
|
+
activemodel (5.1.6)
|
39
|
+
activesupport (= 5.1.6)
|
40
|
+
activerecord (5.1.6)
|
41
|
+
activemodel (= 5.1.6)
|
42
|
+
activesupport (= 5.1.6)
|
43
|
+
arel (~> 8.0)
|
44
|
+
activesupport (5.1.6)
|
49
45
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
50
46
|
i18n (>= 0.7, < 2)
|
51
47
|
minitest (~> 5.1)
|
52
48
|
tzinfo (~> 1.1)
|
53
|
-
arel (
|
49
|
+
arel (8.0.0)
|
54
50
|
ast (2.4.0)
|
55
51
|
builder (3.2.3)
|
56
52
|
byebug (10.0.2)
|
57
53
|
concurrent-ruby (1.0.5)
|
58
|
-
crass (1.0.
|
54
|
+
crass (1.0.3)
|
59
55
|
erubi (1.7.1)
|
60
56
|
globalid (0.4.1)
|
61
57
|
activesupport (>= 4.2.0)
|
62
|
-
i18n (1.0.
|
58
|
+
i18n (1.0.0)
|
63
59
|
concurrent-ruby (~> 1.0)
|
64
|
-
jaro_winkler (1.5.1)
|
65
60
|
loofah (2.2.2)
|
66
61
|
crass (~> 1.0.2)
|
67
62
|
nokogiri (>= 1.5.9)
|
68
63
|
mail (2.7.0)
|
69
64
|
mini_mime (>= 0.1.1)
|
70
|
-
marcel (0.3.2)
|
71
|
-
mimemagic (~> 0.3.2)
|
72
65
|
method_source (0.9.0)
|
73
|
-
mimemagic (0.3.2)
|
74
66
|
mini_mime (1.0.0)
|
75
67
|
mini_portile2 (2.3.0)
|
76
68
|
minitest (5.11.3)
|
77
|
-
nio4r (2.3.
|
78
|
-
nokogiri (1.8.
|
69
|
+
nio4r (2.3.0)
|
70
|
+
nokogiri (1.8.2)
|
79
71
|
mini_portile2 (~> 2.3.0)
|
80
72
|
parallel (1.12.1)
|
81
|
-
parser (2.5.
|
73
|
+
parser (2.5.0.5)
|
82
74
|
ast (~> 2.4.0)
|
83
|
-
powerpack (0.1.
|
84
|
-
rack (2.0.
|
75
|
+
powerpack (0.1.1)
|
76
|
+
rack (2.0.4)
|
85
77
|
rack-proxy (0.6.4)
|
86
78
|
rack
|
87
79
|
rack-test (1.0.0)
|
88
80
|
rack (>= 1.0, < 3)
|
89
|
-
rails (5.
|
90
|
-
actioncable (= 5.
|
91
|
-
actionmailer (= 5.
|
92
|
-
actionpack (= 5.
|
93
|
-
actionview (= 5.
|
94
|
-
activejob (= 5.
|
95
|
-
activemodel (= 5.
|
96
|
-
activerecord (= 5.
|
97
|
-
|
98
|
-
activesupport (= 5.2.0)
|
81
|
+
rails (5.1.6)
|
82
|
+
actioncable (= 5.1.6)
|
83
|
+
actionmailer (= 5.1.6)
|
84
|
+
actionpack (= 5.1.6)
|
85
|
+
actionview (= 5.1.6)
|
86
|
+
activejob (= 5.1.6)
|
87
|
+
activemodel (= 5.1.6)
|
88
|
+
activerecord (= 5.1.6)
|
89
|
+
activesupport (= 5.1.6)
|
99
90
|
bundler (>= 1.3.0)
|
100
|
-
railties (= 5.
|
91
|
+
railties (= 5.1.6)
|
101
92
|
sprockets-rails (>= 2.0.0)
|
102
93
|
rails-dom-testing (2.0.3)
|
103
94
|
activesupport (>= 4.2.0)
|
104
95
|
nokogiri (>= 1.6)
|
105
96
|
rails-html-sanitizer (1.0.4)
|
106
97
|
loofah (~> 2.2, >= 2.2.2)
|
107
|
-
railties (5.
|
108
|
-
actionpack (= 5.
|
109
|
-
activesupport (= 5.
|
98
|
+
railties (5.1.6)
|
99
|
+
actionpack (= 5.1.6)
|
100
|
+
activesupport (= 5.1.6)
|
110
101
|
method_source
|
111
102
|
rake (>= 0.8.7)
|
112
103
|
thor (>= 0.18.1, < 2.0)
|
113
104
|
rainbow (3.0.0)
|
114
105
|
rake (12.3.1)
|
115
|
-
rubocop (0.
|
116
|
-
jaro_winkler (~> 1.5.1)
|
106
|
+
rubocop (0.54.0)
|
117
107
|
parallel (~> 1.10)
|
118
108
|
parser (>= 2.5)
|
119
109
|
powerpack (~> 0.1)
|
@@ -121,7 +111,7 @@ GEM
|
|
121
111
|
ruby-progressbar (~> 1.7)
|
122
112
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
123
113
|
ruby-progressbar (1.9.0)
|
124
|
-
sprockets (3.7.
|
114
|
+
sprockets (3.7.1)
|
125
115
|
concurrent-ruby (~> 1.0)
|
126
116
|
rack (> 1, < 3)
|
127
117
|
sprockets-rails (3.2.1)
|
@@ -132,8 +122,8 @@ GEM
|
|
132
122
|
thread_safe (0.3.6)
|
133
123
|
tzinfo (1.2.5)
|
134
124
|
thread_safe (~> 0.1)
|
135
|
-
unicode-display_width (1.
|
136
|
-
websocket-driver (0.
|
125
|
+
unicode-display_width (1.3.0)
|
126
|
+
websocket-driver (0.6.5)
|
137
127
|
websocket-extensions (>= 0.1.0)
|
138
128
|
websocket-extensions (0.1.3)
|
139
129
|
|
@@ -151,4 +141,4 @@ DEPENDENCIES
|
|
151
141
|
webpacker!
|
152
142
|
|
153
143
|
BUNDLED WITH
|
154
|
-
1.
|
144
|
+
1.16.1
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Webpacker
|
2
2
|
|
3
|
-
![travis-ci status](https://api.travis-ci.org/rails/webpacker.svg?branch=
|
3
|
+
![travis-ci status](https://api.travis-ci.org/rails/webpacker.svg?branch=master)
|
4
4
|
[![node.js](https://img.shields.io/badge/node-%3E%3D%206.0.0-brightgreen.svg)](https://nodejs.org/en/)
|
5
5
|
[![Gem](https://img.shields.io/gem/v/webpacker.svg)](https://github.com/rails/webpacker)
|
6
6
|
|
@@ -81,7 +81,7 @@ Or add it to your `Gemfile`:
|
|
81
81
|
|
82
82
|
```ruby
|
83
83
|
# Gemfile
|
84
|
-
gem 'webpacker', '~> 3.
|
84
|
+
gem 'webpacker', '~> 3.4'
|
85
85
|
|
86
86
|
# OR if you prefer to use master
|
87
87
|
gem 'webpacker', git: 'https://github.com/rails/webpacker.git'
|
@@ -154,7 +154,7 @@ in the `app/javascript/packs/*.js` files and automatically reload the browser to
|
|
154
154
|
./bin/webpack-dev-server
|
155
155
|
|
156
156
|
# watcher
|
157
|
-
./bin/webpack --
|
157
|
+
./bin/webpack --colors --progress
|
158
158
|
|
159
159
|
# standalone build
|
160
160
|
./bin/webpack
|
@@ -186,7 +186,7 @@ WEBPACKER_DEV_SERVER_HOST=0.0.0.0 ./bin/webpack-dev-server
|
|
186
186
|
**Note:** You need to allow webpack-dev-server host as an allowed origin for `connect-src` if you are running your application in a restrict CSP environment (like Rails 5.2+). This can be done in Rails 5.2+ in the CSP initializer `config/initializers/content_security_policy.rb` with a snippet like this:
|
187
187
|
|
188
188
|
```ruby
|
189
|
-
|
189
|
+
p.connect_src :self, :https, 'http://localhost:3035', 'ws://localhost:3035' if Rails.env.development?
|
190
190
|
```
|
191
191
|
|
192
192
|
**Note:** Don't forget to prefix `ruby` when running these binstubs on Windows
|
@@ -248,7 +248,7 @@ bundle exec rails webpacker:compile
|
|
248
248
|
|
249
249
|
### Upgrading
|
250
250
|
|
251
|
-
You can run following commands to upgrade Webpacker to the latest stable version. This process involves upgrading the gem and related
|
251
|
+
You can run following commands to upgrade Webpacker to the latest stable version. This process involves upgrading the gem and related npm modules:
|
252
252
|
|
253
253
|
```bash
|
254
254
|
bundle update webpacker
|
@@ -258,7 +258,7 @@ yarn add webpack-dev-server@^2.11.1
|
|
258
258
|
|
259
259
|
### Yarn Integrity
|
260
260
|
|
261
|
-
By default, in development, webpacker runs a yarn integrity check to ensure that all local
|
261
|
+
By default, in development, webpacker runs a yarn integrity check to ensure that all local npm packages are up-to-date. This is similar to what bundler does currently in Rails, but for JavaScript packages. If your system is out of date, then Rails will not initialize. You will be asked to upgrade your local npm packages by running `yarn install`.
|
262
262
|
|
263
263
|
To turn off this option, you will need to override the default by adding a new config option to your Rails development environment configuration file (`config/environment/development.rb`):
|
264
264
|
|
@@ -324,9 +324,9 @@ with the following code:
|
|
324
324
|
|
325
325
|
```ruby
|
326
326
|
if Rails.env.development?
|
327
|
-
|
327
|
+
p.script_src :self, :https, :unsafe_eval
|
328
328
|
else
|
329
|
-
|
329
|
+
p.script_src :self, :https
|
330
330
|
end
|
331
331
|
```
|
332
332
|
|
@@ -352,9 +352,9 @@ configuration:
|
|
352
352
|
|
353
353
|
```ruby
|
354
354
|
if Rails.env.development?
|
355
|
-
|
355
|
+
p.script_src :self, :https, :unsafe_eval
|
356
356
|
else
|
357
|
-
|
357
|
+
p.script_src :self, :https
|
358
358
|
end
|
359
359
|
```
|
360
360
|
You can read more about this in the [Vue docs](https://vuejs.org/v2/guide/installation.html#CSP-environments).
|
@@ -486,7 +486,7 @@ Webpacker::Compiler.watched_paths << 'bower_components'
|
|
486
486
|
|
487
487
|
## Deployment
|
488
488
|
|
489
|
-
Webpacker hooks up a new `webpacker:compile` task to `assets:precompile`, which gets run whenever you run `assets:precompile`. If you are not using Sprockets, `webpacker:compile` is automatically aliased to `assets:precompile`.
|
489
|
+
Webpacker hooks up a new `webpacker:compile` task to `assets:precompile`, which gets run whenever you run `assets:precompile`. If you are not using Sprockets, `webpacker:compile` is automatically aliased to `assets:precompile`. Remember to set NODE_ENV environment variable to production during deployment or when running this rake task.
|
490
490
|
|
491
491
|
## Docs
|
492
492
|
|
data/Rakefile
CHANGED
data/docs/cloud9.md
CHANGED
data/docs/css.md
CHANGED
@@ -144,13 +144,3 @@ environment.loaders.get('sass').use.splice(-1, 0, {
|
|
144
144
|
}
|
145
145
|
});
|
146
146
|
```
|
147
|
-
|
148
|
-
## Configure [Autoprefixer](https://github.com/postcss/autoprefixer)
|
149
|
-
|
150
|
-
By default, Autoprefixer does not apply Internet Explorer CSS grid polyfills. If you wish to enable these, or change any other Autoprefixer config, do it through `.postcssrc.yml`:
|
151
|
-
|
152
|
-
```yml
|
153
|
-
plugins:
|
154
|
-
postcss-import: {}
|
155
|
-
postcss-cssnext: { features: { autoprefixer: { grid: true } } }
|
156
|
-
```
|
data/docs/troubleshooting.md
CHANGED
@@ -100,9 +100,9 @@ Rails.application.config.assets.js_compressor = :uglifier
|
|
100
100
|
|
101
101
|
```
|
102
102
|
|
103
|
-
|
103
|
+
### Angular: WARNING in ./node_modules/@angular/core/esm5/core.js, Critical dependency: the request of a dependency is an expression
|
104
104
|
|
105
|
-
To
|
105
|
+
To silent these warnings, please update `config/webpack/environment.js`
|
106
106
|
|
107
107
|
```js
|
108
108
|
// environment.js
|
data/lib/install/angular.rb
CHANGED
@@ -14,9 +14,9 @@ if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR > 1
|
|
14
14
|
say "This can be done in Rails 5.2+ for development environment in the CSP initializer", :yellow
|
15
15
|
say "config/initializers/content_security_policy.rb with a snippet like this:", :yellow
|
16
16
|
say "if Rails.env.development?", :yellow
|
17
|
-
say "
|
17
|
+
say " p.script_src :self, :https, :unsafe_eval", :yellow
|
18
18
|
say "else", :yellow
|
19
|
-
say "
|
19
|
+
say " p.script_src :self, :https", :yellow
|
20
20
|
say "end", :yellow
|
21
21
|
end
|
22
22
|
|
data/lib/install/bin/webpack
CHANGED
@@ -5,7 +5,6 @@ default: &default
|
|
5
5
|
source_entry_path: packs
|
6
6
|
public_output_path: packs
|
7
7
|
cache_path: tmp/cache/webpacker
|
8
|
-
webpack_compile_output: false
|
9
8
|
|
10
9
|
# Additional paths webpack should lookup modules
|
11
10
|
# ['app/assets', 'engine/foo/app/assets']
|
@@ -49,7 +48,7 @@ development:
|
|
49
48
|
headers:
|
50
49
|
'Access-Control-Allow-Origin': '*'
|
51
50
|
watch_options:
|
52
|
-
ignored:
|
51
|
+
ignored: /node_modules/
|
53
52
|
|
54
53
|
|
55
54
|
test:
|