webpacker 6.0.0.pre.2 → 6.0.0.rc.6
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/.github/workflows/jest.yml +7 -15
- data/.github/workflows/js-lint.yml +7 -15
- data/.github/workflows/rubocop.yml +1 -1
- data/.github/workflows/ruby.yml +18 -40
- data/.node-version +1 -1
- data/.rubocop.yml +107 -1
- data/CHANGELOG.md +48 -9
- data/CONTRIBUTING.md +20 -1
- data/Gemfile.lock +107 -104
- data/README.md +387 -177
- data/config/README.md +3 -0
- data/config/webpacker.yml +1 -0
- data/docs/deployment.md +9 -29
- data/docs/developing_webpacker.md +29 -0
- data/docs/troubleshooting.md +61 -25
- data/docs/v6_upgrade.md +113 -0
- data/gemfiles/Gemfile-rails-edge +1 -1
- data/gemfiles/Gemfile-rails.6.1.x +12 -0
- data/lib/install/{javascript/packs/application.js → application.js} +2 -5
- data/lib/install/bin/webpack +4 -7
- data/lib/install/bin/yarn +18 -0
- data/lib/install/config/webpacker.yml +18 -17
- data/lib/install/package.json +15 -0
- data/lib/install/template.rb +50 -21
- data/lib/tasks/webpacker/binstubs.rake +2 -2
- data/lib/tasks/webpacker/check_node.rake +3 -0
- data/lib/tasks/webpacker/check_yarn.rake +4 -1
- data/lib/tasks/webpacker/clobber.rake +1 -1
- data/lib/tasks/webpacker/install.rake +2 -2
- data/lib/tasks/webpacker/verify_config.rake +14 -0
- data/lib/tasks/webpacker/verify_install.rake +1 -11
- data/lib/tasks/yarn.rake +38 -0
- data/lib/webpacker/commands.rb +21 -16
- data/lib/webpacker/compiler.rb +9 -3
- data/lib/webpacker/configuration.rb +19 -8
- data/lib/webpacker/dev_server.rb +6 -0
- data/lib/webpacker/dev_server_runner.rb +7 -2
- data/lib/webpacker/env.rb +5 -1
- data/lib/webpacker/helper.rb +26 -50
- data/lib/webpacker/instance.rb +4 -0
- data/lib/webpacker/manifest.rb +1 -2
- data/lib/webpacker/railtie.rb +8 -2
- data/lib/webpacker/runner.rb +1 -1
- data/lib/webpacker/version.rb +1 -1
- data/lib/webpacker/webpack_runner.rb +27 -6
- data/lib/webpacker.rb +1 -1
- data/package/__tests__/development.js +4 -10
- data/package/__tests__/env.js +8 -4
- data/package/__tests__/index.js +9 -0
- data/package/babel/preset.js +24 -14
- data/package/config.js +3 -3
- data/package/env.js +6 -3
- data/package/environments/__tests__/base.js +7 -7
- data/package/environments/base.js +25 -25
- data/package/environments/development.js +36 -35
- data/package/environments/production.js +28 -30
- data/package/index.js +9 -2
- data/package/inliningCss.js +7 -0
- data/package/rules/babel.js +1 -1
- data/package/rules/coffee.js +5 -5
- data/package/rules/erb.js +5 -3
- data/package/rules/file.js +5 -3
- data/package/rules/index.js +9 -17
- data/package/rules/less.js +14 -10
- data/package/rules/raw.js +5 -0
- data/package/rules/sass.js +12 -9
- data/package/rules/stylus.js +26 -0
- data/package/utils/get_style_rule.js +28 -30
- data/package/utils/helpers.js +25 -0
- data/package.json +25 -29
- data/test/command_test.rb +76 -0
- data/test/configuration_test.rb +3 -3
- data/test/dev_server_runner_test.rb +13 -2
- data/test/helper_test.rb +69 -61
- data/test/manifest_test.rb +16 -0
- data/test/mounted_app/test/dummy/config/webpacker.yml +4 -4
- data/test/test_app/app/{javascript/packs → packs/entrypoints}/application.js +1 -1
- data/test/test_app/config/initializers/inspect_autoload_paths.rb +1 -0
- data/test/test_app/config/webpacker.yml +4 -6
- data/test/test_app/config/webpacker_other_location.yml +79 -0
- data/test/test_app/public/packs/manifest.json +19 -5
- data/test/webpacker_test.rb +21 -0
- data/webpacker.gemspec +2 -2
- data/yarn.lock +2357 -3262
- metadata +34 -41
- data/docs/assets.md +0 -135
- data/docs/cloud9.md +0 -310
- data/docs/css.md +0 -303
- data/docs/docker.md +0 -68
- data/docs/engines.md +0 -213
- data/docs/env.md +0 -68
- data/docs/es6.md +0 -72
- data/docs/folder-structure.md +0 -66
- data/docs/integrations.md +0 -220
- data/docs/misc.md +0 -23
- data/docs/props.md +0 -187
- data/docs/react.md +0 -183
- data/docs/target.md +0 -22
- data/docs/testing.md +0 -147
- data/docs/typescript.md +0 -190
- data/docs/v4-upgrade.md +0 -142
- data/docs/webpack-dev-server.md +0 -94
- data/docs/webpack.md +0 -315
- data/docs/yarn.md +0 -23
- data/lib/install/examples/vue3/app.vue +0 -27
- data/lib/install/examples/vue3/hello_vue.js +0 -15
- data/lib/install/javascript/packs/application.css +0 -9
- data/package/babel/preset-react.js +0 -62
- data/package/rules/svg.js +0 -23
- /data/test/test_app/app/{javascript/packs → packs/entrypoints}/multi_entry.css +0 -0
- /data/test/test_app/app/{javascript/packs → packs/entrypoints}/multi_entry.js +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb700e8975b2ec865da84e152fea23586c8e7a2a428465230255ab97ebe482ce
|
|
4
|
+
data.tar.gz: c2a023d554364442cd356771cad8b42226a3d6ce3a4708b6a5603151aad886ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb863173d2577d304c03a4e6d66eddc385a62950bf30af00ed29c4abb9039b0290402771f58c9ede11cf9f26d5945136997d78148590871b7247e13b4d3db7cf
|
|
7
|
+
data.tar.gz: a624efeabf2bdbd7b83b59aa2854e4ebda00c5c476849c03fc585d967810b30fd5d118fbf13f412c40cb6e7fa1fe020f619cc9ede0cd72989c25504f3f8e0e53
|
data/.github/workflows/jest.yml
CHANGED
|
@@ -3,33 +3,25 @@ name: Jest specs
|
|
|
3
3
|
on: [push, pull_request]
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
|
-
|
|
6
|
+
jest:
|
|
7
7
|
name: Jest specs
|
|
8
8
|
strategy:
|
|
9
9
|
matrix:
|
|
10
10
|
os: [ubuntu-latest]
|
|
11
|
-
node: [
|
|
11
|
+
node: [12.x, 14.x, 16.x]
|
|
12
12
|
|
|
13
13
|
runs-on: ${{ matrix.os }}
|
|
14
14
|
|
|
15
15
|
steps:
|
|
16
16
|
- uses: actions/checkout@v2
|
|
17
|
-
- name: Get yarn cache directory path
|
|
18
|
-
id: yarn-cache-dir-path
|
|
19
|
-
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
20
|
-
|
|
21
|
-
- uses: actions/cache@v2
|
|
22
|
-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
23
|
-
with:
|
|
24
|
-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
25
|
-
key: ${{ runner.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
26
|
-
restore-keys: |
|
|
27
|
-
${{ runner.os }}-${{ matrix.node }}-yarn-
|
|
28
|
-
|
|
29
17
|
- name: Use Node.js ${{ matrix.node }}
|
|
30
|
-
uses: actions/setup-node@
|
|
18
|
+
uses: actions/setup-node@v2
|
|
31
19
|
with:
|
|
32
20
|
node-version: ${{ matrix.node }}
|
|
21
|
+
cache: yarn
|
|
22
|
+
|
|
23
|
+
- name: Install yarn maybe
|
|
24
|
+
run: which yarn || npm install -g yarn
|
|
33
25
|
|
|
34
26
|
- name: Install dependencies
|
|
35
27
|
run: yarn --frozen-lockfile
|
|
@@ -3,34 +3,26 @@ name: JS lint
|
|
|
3
3
|
on: [push, pull_request]
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
|
-
|
|
6
|
+
js-lint:
|
|
7
7
|
name: JS Lint
|
|
8
8
|
|
|
9
9
|
strategy:
|
|
10
10
|
matrix:
|
|
11
11
|
os: [ubuntu-latest]
|
|
12
|
-
node: [
|
|
12
|
+
node: [14]
|
|
13
13
|
|
|
14
14
|
runs-on: ${{ matrix.os }}
|
|
15
15
|
|
|
16
16
|
steps:
|
|
17
17
|
- uses: actions/checkout@v2
|
|
18
|
-
- name: Get yarn cache directory path
|
|
19
|
-
id: yarn-cache-dir-path
|
|
20
|
-
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
21
|
-
|
|
22
|
-
- uses: actions/cache@v2
|
|
23
|
-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
24
|
-
with:
|
|
25
|
-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
26
|
-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
27
|
-
restore-keys: |
|
|
28
|
-
${{ runner.os }}-yarn-
|
|
29
|
-
|
|
30
18
|
- name: Use Node.js ${{ matrix.node }}
|
|
31
|
-
uses: actions/setup-node@
|
|
19
|
+
uses: actions/setup-node@v2
|
|
32
20
|
with:
|
|
33
21
|
node-version: ${{ matrix.node }}
|
|
22
|
+
cache: yarn
|
|
23
|
+
|
|
24
|
+
- name: Install yarn maybe
|
|
25
|
+
run: which yarn || npm install -g yarn
|
|
34
26
|
|
|
35
27
|
- name: Install dependencies
|
|
36
28
|
run: yarn --frozen-lockfile
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -3,68 +3,46 @@ name: Ruby specs
|
|
|
3
3
|
on: [push, pull_request]
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
|
-
|
|
6
|
+
test:
|
|
7
7
|
name: Ruby specs
|
|
8
8
|
runs-on: ${{ matrix.os }}
|
|
9
9
|
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' || matrix.experimental }}
|
|
10
|
-
env:
|
|
11
|
-
BUNDLE_JOBS: 4
|
|
12
|
-
BUNDLE_RETRY: 3
|
|
13
10
|
strategy:
|
|
14
11
|
fail-fast: false
|
|
15
12
|
matrix:
|
|
16
13
|
os: [ubuntu-latest]
|
|
17
|
-
ruby:
|
|
18
|
-
2.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
2.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"gemfiles/Gemfile-rails.5.2.x",
|
|
25
|
-
"gemfiles/Gemfile-rails.6.0.x"
|
|
26
|
-
]
|
|
14
|
+
ruby:
|
|
15
|
+
- 2.7
|
|
16
|
+
- "3.0"
|
|
17
|
+
gemfile:
|
|
18
|
+
- gemfiles/Gemfile-rails.5.2.x
|
|
19
|
+
- gemfiles/Gemfile-rails.6.0.x
|
|
20
|
+
- gemfiles/Gemfile-rails.6.1.x
|
|
27
21
|
exclude:
|
|
28
|
-
- ruby:
|
|
29
|
-
gemfile: gemfiles/Gemfile-rails.6.
|
|
22
|
+
- ruby: 2.5
|
|
23
|
+
gemfile: gemfiles/Gemfile-rails.6.1.x
|
|
24
|
+
- ruby: "3.0"
|
|
25
|
+
gemfile: gemfiles/Gemfile-rails.5.2.x
|
|
30
26
|
experimental: [false]
|
|
31
27
|
include:
|
|
32
|
-
- ruby:
|
|
33
|
-
os: ubuntu-latest
|
|
34
|
-
gemfile: gemfiles/Gemfile-rails.6.0.x
|
|
35
|
-
experimental: true
|
|
36
|
-
- ruby: head
|
|
37
|
-
os: ubuntu-latest
|
|
38
|
-
gemfile: gemfiles/Gemfile-rails-edge
|
|
39
|
-
experimental: true
|
|
40
|
-
- ruby: 2.6
|
|
28
|
+
- ruby: 2.7
|
|
41
29
|
os: ubuntu-latest
|
|
42
30
|
gemfile: gemfiles/Gemfile-rails-edge
|
|
43
31
|
experimental: true
|
|
44
|
-
- ruby:
|
|
32
|
+
- ruby: "3.0"
|
|
45
33
|
os: ubuntu-latest
|
|
46
34
|
gemfile: gemfiles/Gemfile-rails-edge
|
|
47
35
|
experimental: true
|
|
48
36
|
|
|
37
|
+
env:
|
|
38
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
49
39
|
steps:
|
|
50
40
|
- uses: actions/checkout@v2
|
|
51
|
-
- uses: actions/cache@v2
|
|
52
|
-
with:
|
|
53
|
-
path: /home/runner/bundle
|
|
54
|
-
key: bundle-use-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-gems-${{ hashFiles(matrix.gemfile) }}-${{ hashFiles('**/*.gemspec') }}
|
|
55
|
-
restore-keys: |
|
|
56
|
-
bundle-use-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-gems-
|
|
57
41
|
|
|
58
42
|
- uses: ruby/setup-ruby@v1
|
|
59
43
|
with:
|
|
60
44
|
ruby-version: ${{ matrix.ruby }}
|
|
61
|
-
|
|
62
|
-
- name: Bundle install
|
|
63
|
-
run: |
|
|
64
|
-
gem install bundler -v 2.1.4
|
|
65
|
-
bundle config path /home/runner/bundle
|
|
66
|
-
bundle config --global gemfile ${{ matrix.gemfile }}
|
|
67
|
-
bundle install --jobs 4 --retry 3
|
|
45
|
+
bundler-cache: true # Run "bundle install", and cache the result automatically.
|
|
68
46
|
|
|
69
47
|
- name: Ruby specs
|
|
70
|
-
run: bundle exec rake
|
|
48
|
+
run: bundle exec rake
|
data/.node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
16.7.0
|
data/.rubocop.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require: rubocop-performance
|
|
2
2
|
AllCops:
|
|
3
|
-
TargetRubyVersion: 2.
|
|
3
|
+
TargetRubyVersion: 2.7
|
|
4
4
|
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
|
5
5
|
# to ignore them, so only the ones explicitly set in this file are enabled.
|
|
6
6
|
DisabledByDefault: true
|
|
@@ -8,6 +8,7 @@ AllCops:
|
|
|
8
8
|
- "lib/install/templates/**"
|
|
9
9
|
- "vendor/**/*"
|
|
10
10
|
- "node_modules/**/*"
|
|
11
|
+
- "_actions/**/*"
|
|
11
12
|
|
|
12
13
|
# Prefer &&/|| over and/or.
|
|
13
14
|
Style/AndOr:
|
|
@@ -118,3 +119,108 @@ Layout/EndAlignment:
|
|
|
118
119
|
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
|
119
120
|
Lint/RequireParentheses:
|
|
120
121
|
Enabled: true
|
|
122
|
+
|
|
123
|
+
# Use `bind_call(obj, args, ...)` instead of `bind(obj).call(args, ...)`.
|
|
124
|
+
Performance/BindCall:
|
|
125
|
+
Enabled: true
|
|
126
|
+
|
|
127
|
+
# Use `caller(n..n)` instead of `caller`.
|
|
128
|
+
Performance/Caller:
|
|
129
|
+
Enabled: true
|
|
130
|
+
|
|
131
|
+
# Use `casecmp` for case comparison.
|
|
132
|
+
Performance/Casecmp:
|
|
133
|
+
Enabled: true
|
|
134
|
+
|
|
135
|
+
# Extract Array and Hash literals outside of loops into local variables or constants.
|
|
136
|
+
Performance/CollectionLiteralInLoop:
|
|
137
|
+
Enabled: true
|
|
138
|
+
|
|
139
|
+
# Prefer `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.
|
|
140
|
+
Performance/CompareWithBlock:
|
|
141
|
+
Enabled: true
|
|
142
|
+
|
|
143
|
+
# Use `count` instead of `{select,find_all,filter,reject}...{size,count,length}`.
|
|
144
|
+
Performance/Count:
|
|
145
|
+
Enabled: true
|
|
146
|
+
|
|
147
|
+
# Use `delete_prefix` instead of `gsub`.
|
|
148
|
+
Performance/DeletePrefix:
|
|
149
|
+
Enabled: true
|
|
150
|
+
|
|
151
|
+
# Use `delete_suffix` instead of `gsub`.
|
|
152
|
+
Performance/DeleteSuffix:
|
|
153
|
+
Enabled: true
|
|
154
|
+
|
|
155
|
+
# Use `detect` instead of `select.first`, `find_all.first`, `filter.first`, `select.last`, `find_all.last`, and `filter.last`.
|
|
156
|
+
Performance/Detect:
|
|
157
|
+
Enabled: true
|
|
158
|
+
|
|
159
|
+
# Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
|
|
160
|
+
Performance/DoubleStartEndWith:
|
|
161
|
+
Enabled: true
|
|
162
|
+
|
|
163
|
+
# Use `end_with?` instead of a regex match anchored to the end of a string.
|
|
164
|
+
Performance/EndWith:
|
|
165
|
+
Enabled: true
|
|
166
|
+
|
|
167
|
+
# Do not compute the size of statically sized objects except in constants.
|
|
168
|
+
Performance/FixedSize:
|
|
169
|
+
Enabled: true
|
|
170
|
+
|
|
171
|
+
# Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1).
|
|
172
|
+
Performance/FlatMap:
|
|
173
|
+
Enabled: true
|
|
174
|
+
|
|
175
|
+
# Use `key?` or `value?` instead of `keys.include?` or `values.include?`.
|
|
176
|
+
Performance/InefficientHashSearch:
|
|
177
|
+
Enabled: true
|
|
178
|
+
|
|
179
|
+
# Use `Range#cover?` instead of `Range#include?` (or `Range#member?`).
|
|
180
|
+
Performance/RangeInclude:
|
|
181
|
+
Enabled: true
|
|
182
|
+
|
|
183
|
+
# Use `yield` instead of `block.call`.
|
|
184
|
+
Performance/RedundantBlockCall:
|
|
185
|
+
Enabled: true
|
|
186
|
+
|
|
187
|
+
# Use `=~` instead of `String#match` or `Regexp#match` in a context where the returned `MatchData` is not needed.
|
|
188
|
+
Performance/RedundantMatch:
|
|
189
|
+
Enabled: true
|
|
190
|
+
|
|
191
|
+
# Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
|
|
192
|
+
Performance/RedundantMerge:
|
|
193
|
+
Enabled: true
|
|
194
|
+
|
|
195
|
+
# Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`, `Regexp#===`, or `=~` when `MatchData` is not used.
|
|
196
|
+
Performance/RegexpMatch:
|
|
197
|
+
Enabled: true
|
|
198
|
+
|
|
199
|
+
# Use `reverse_each` instead of `reverse.each`.
|
|
200
|
+
Performance/ReverseEach:
|
|
201
|
+
Enabled: true
|
|
202
|
+
|
|
203
|
+
# Use `size` instead of `count` for counting the number of elements in `Array` and `Hash`.
|
|
204
|
+
Performance/Size:
|
|
205
|
+
Enabled: true
|
|
206
|
+
|
|
207
|
+
# Use `start_with?` instead of a regex match anchored to the beginning of a string.
|
|
208
|
+
Performance/StartWith:
|
|
209
|
+
Enabled: true
|
|
210
|
+
|
|
211
|
+
# Use `tr` instead of `gsub` when you are replacing the same number of characters.
|
|
212
|
+
# Use `delete` instead of `gsub` when you are deleting characters.
|
|
213
|
+
Performance/StringReplacement:
|
|
214
|
+
Enabled: true
|
|
215
|
+
|
|
216
|
+
# Checks for .times.map calls.
|
|
217
|
+
Performance/TimesMap:
|
|
218
|
+
Enabled: true
|
|
219
|
+
|
|
220
|
+
# Use unary plus to get an unfrozen string literal.
|
|
221
|
+
Performance/UnfreezeString:
|
|
222
|
+
Enabled: true
|
|
223
|
+
|
|
224
|
+
# Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.
|
|
225
|
+
Performance/UriDefaultParser:
|
|
226
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
|
@@ -2,24 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
**Please note that Webpacker 4.1.0 has an installer bug. Please use 4.2.0 or above**
|
|
4
4
|
|
|
5
|
-
## [[6.0.0]](https://github.com/rails/webpacker/compare/v5.
|
|
5
|
+
## [[6.0.0]](https://github.com/rails/webpacker/compare/v5.4.3...master) - 2021-TBD
|
|
6
|
+
|
|
7
|
+
Please see [UPGRADE GUIDE](./docs/v6_upgrade.md) for more information.
|
|
6
8
|
|
|
7
9
|
- `node_modules` will no longer be compiled by default. This primarily fixes [rails issue #35501](https://github.com/rails/rails/issues/35501) as well as [numerous other webpacker issues](https://github.com/rails/webpacker/issues/2131#issuecomment-581618497). The disabled loader can still be required explicitly via:
|
|
10
|
+
|
|
8
11
|
```js
|
|
9
12
|
const nodeModules = require('@rails/webpacker/rules/node_modules.js')
|
|
10
13
|
environment.loaders.append('nodeModules', nodeModules)
|
|
11
14
|
```
|
|
15
|
+
|
|
12
16
|
- If you have added `environment.loaders.delete('nodeModules')` to your `environment.js`, this must be removed or you will receive an error (`Item nodeModules not found`).
|
|
13
|
-
-
|
|
17
|
+
- `extract_css` option was removed. Webpacker will generate a separate `application.css` file for the default `application` pack, as supported by multiple files per entry introduced in 5.0.0. [#2608](https://github.com/rails/webpacker/pull/2608). However, CSS will be inlined when the webpack-dev-server is used with `hmr: true`. JS package exports `inliningCss`. This is useful to enable HMR for React.
|
|
14
18
|
- Webpacker's wrapper to the `splitChunks()` API will now default `runtimeChunk: 'single'` which will help prevent potential issues when using multiple entry points per page [#2708](https://github.com/rails/webpacker/pull/2708).
|
|
15
19
|
- Changes `@babel/preset-env` modules option to `'auto'` per recommendation in the Babel docs [#2709](https://github.com/rails/webpacker/pull/2709)
|
|
16
20
|
- Adds experimental Yarn 2 support. Note you must manually set `nodeLinker: node-modules` in your `.yarnrc.yml`.
|
|
21
|
+
- Fixes dev server issues [#2898](https://github.com/rails/webpacker/pull/2898)
|
|
22
|
+
- Update static files path to from `media/` to `static/`.
|
|
23
|
+
|
|
24
|
+
### Breaking changes
|
|
25
|
+
- Removed integration installers
|
|
26
|
+
- Splitchunks enabled by default
|
|
27
|
+
- CSS extraction enabled by default, except when devServer is configured and running
|
|
28
|
+
|
|
29
|
+
## [[5.4.3]](https://github.com/rails/webpacker/compare/v5.4.2...v5.4.3) - 2021-09-14
|
|
30
|
+
|
|
31
|
+
- Specify webpack-dev-server to be v3, to avoid getting webpack-dev-server v4 ([#3121](https://github.com/rails/webpacker/pull/3121))
|
|
32
|
+
|
|
33
|
+
## [[5.4.2]](https://github.com/rails/webpacker/compare/v5.4.1...v5.4.2) - 2021-08-20
|
|
34
|
+
|
|
35
|
+
- Fix babel warning about private-methods in `@babel/plugin-proposal-private-property-in-object` as well ([67fa6edf](https://github.com/rails/webpacker/commit/67fa6edf697340cbd5a5518afebac871ef74769b)).
|
|
36
|
+
|
|
37
|
+
## [[5.4.1]](https://github.com/rails/webpacker/compare/v5.4.0...v5.4.1) - 2021-08-20
|
|
17
38
|
|
|
18
|
-
|
|
39
|
+
- Update all dependencies within the same major version ([#3120](https://github.com/rails/webpacker/pull/3120))
|
|
40
|
+
- Fix babel warning about private-methods ([#3016](https://github.com/rails/webpacker/pull/3016))
|
|
41
|
+
|
|
42
|
+
## [[5.4.0]](https://github.com/rails/webpacker/compare/v5.3.0...v5.4.0) - 2021-05-18
|
|
43
|
+
|
|
44
|
+
- Fix compatibility with Psych 4 ([ceaf826d](https://github.com/rails/webpacker/commit/ceaf826d84230aaadbefdbaaf560d474a96affcc))
|
|
45
|
+
|
|
46
|
+
## [[5.3.0]](https://github.com/rails/webpacker/compare/v5.2.1...v5.3.0) - 2021-04-27
|
|
47
|
+
|
|
48
|
+
- Adds experimental Yarn 2 support. Note you must manually set `nodeLinker: node-modules` in your `.yarnrc.yml`.
|
|
49
|
+
- Keep backups, even when they're old [#2912](https://github.com/rails/webpacker/pull/2912)
|
|
50
|
+
|
|
51
|
+
## [[5.2.2]](https://github.com/rails/webpacker/compare/v5.2.1...v5.2.2) - 2021-04-27
|
|
52
|
+
|
|
53
|
+
- Bump deps and remove node-sass [#2997](https://github.com/rails/webpacker/pull/2997).
|
|
54
|
+
|
|
55
|
+
## [[5.2.1]](https://github.com/rails/webpacker/compare/v5.2.0...v5.2.1) - 2020-08-17
|
|
19
56
|
|
|
20
57
|
- Revert [#1311](https://github.com/rails/webpacker/pull/1311).
|
|
21
58
|
|
|
22
|
-
## [[5.2.0]](https://github.com/rails/webpacker/compare/v5.1.1...
|
|
59
|
+
## [[5.2.0]](https://github.com/rails/webpacker/compare/v5.1.1...v5.2.0) - 2020-08-16
|
|
23
60
|
|
|
24
61
|
- Bump dependencies and fixes. See [diff](https://github.com/rails/webpacker/compare/v5.1.1...5-x-stable) for changes.
|
|
25
62
|
|
|
@@ -346,7 +383,7 @@ const { environment } = require('@rails/webpacker')
|
|
|
346
383
|
// Enable with default config
|
|
347
384
|
environment.splitChunks()
|
|
348
385
|
// Configure via a callback
|
|
349
|
-
environment.splitChunks(config =>
|
|
386
|
+
environment.splitChunks((config) =>
|
|
350
387
|
Object.assign({}, config, { optimization: { splitChunks: false } })
|
|
351
388
|
)
|
|
352
389
|
```
|
|
@@ -398,7 +435,7 @@ See changes: https://github.com/rails/webpacker/compare/e8b197e36c77181ca2e4765c
|
|
|
398
435
|
|
|
399
436
|
### Added
|
|
400
437
|
|
|
401
|
-
- On CI, sort files & check modified w/ digest
|
|
438
|
+
- On CI, sort files & check modified w/ digest instead of mtime[#1522](https://github.com/rails/webpacker/pull/1522)
|
|
402
439
|
|
|
403
440
|
## [3.5.3] - 2018-05-03
|
|
404
441
|
|
|
@@ -670,7 +707,9 @@ environment.resolvedModules.append('vendor', 'vendor')
|
|
|
670
707
|
```js
|
|
671
708
|
// Enable css modules with sass loader
|
|
672
709
|
const sassLoader = environment.loaders.get('sass')
|
|
673
|
-
const cssLoader = sassLoader.use.find(
|
|
710
|
+
const cssLoader = sassLoader.use.find(
|
|
711
|
+
(loader) => loader.loader === 'css-loader'
|
|
712
|
+
)
|
|
674
713
|
|
|
675
714
|
cssLoader.options = Object.assign({}, cssLoader.options, {
|
|
676
715
|
modules: true,
|
|
@@ -790,11 +829,11 @@ yarn add coffeescript
|
|
|
790
829
|
|
|
791
830
|
### Added
|
|
792
831
|
|
|
793
|
-
- `resolved_paths` option to allow adding additional paths webpack should
|
|
832
|
+
- `resolved_paths` option to allow adding additional paths webpack should look up when resolving modules
|
|
794
833
|
|
|
795
834
|
```yml
|
|
796
835
|
# config/webpacker.yml
|
|
797
|
-
# Additional paths webpack should
|
|
836
|
+
# Additional paths webpack should look up modules
|
|
798
837
|
resolved_paths: [] # empty by default
|
|
799
838
|
```
|
|
800
839
|
|
data/CONTRIBUTING.md
CHANGED
|
@@ -3,31 +3,50 @@
|
|
|
3
3
|
1. Install [Yarn](https://yarnpkg.com/)
|
|
4
4
|
|
|
5
5
|
2. Run the following commands to set up the development environment.
|
|
6
|
+
|
|
6
7
|
```
|
|
7
8
|
bundle install
|
|
8
9
|
yarn
|
|
9
10
|
```
|
|
10
11
|
|
|
11
12
|
## Making sure your changes pass all tests
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
There are a number of automated checks which run on GitHub Actions when a pull request is created.
|
|
15
|
+
|
|
13
16
|
You can run those checks on your own locally to make sure that your changes would not break the CI build.
|
|
14
17
|
|
|
15
18
|
### 1. Check the code for JavaScript style violations
|
|
19
|
+
|
|
16
20
|
```
|
|
17
21
|
yarn lint
|
|
18
22
|
```
|
|
19
23
|
|
|
20
24
|
### 2. Check the code for Ruby style violations
|
|
25
|
+
|
|
21
26
|
```
|
|
22
27
|
bundle exec rubocop
|
|
23
28
|
```
|
|
24
29
|
|
|
25
30
|
### 3. Run the JavaScript test suite
|
|
31
|
+
|
|
26
32
|
```
|
|
27
33
|
yarn test
|
|
28
34
|
```
|
|
29
35
|
|
|
30
36
|
### 4. Run the Ruby test suite
|
|
37
|
+
|
|
31
38
|
```
|
|
32
39
|
bundle exec rake test
|
|
33
40
|
```
|
|
41
|
+
|
|
42
|
+
#### 4.1 Run a single ruby test file
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
bundle exec rake test TEST=test/rake_tasks_test.rb
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### 4.2 Run a single ruby test
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
ruby -I test test/rake_tasks_test.rb -n test_rake_webpacker_install
|
|
52
|
+
```
|