webpacker 6.0.0.beta.6 → 6.0.0.pre.1
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 +1 -1
- data/.github/workflows/js-lint.yml +1 -1
- data/.github/workflows/ruby.yml +6 -9
- data/CHANGELOG.md +4 -20
- data/CONTRIBUTING.md +1 -1
- data/Gemfile.lock +5 -7
- data/README.md +109 -306
- data/docs/assets.md +135 -0
- data/docs/cloud9.md +310 -0
- data/docs/css.md +303 -0
- data/docs/deployment.md +148 -0
- data/docs/docker.md +68 -0
- data/docs/engines.md +213 -0
- data/docs/env.md +68 -0
- data/docs/es6.md +72 -0
- data/docs/folder-structure.md +66 -0
- data/docs/integrations.md +220 -0
- data/docs/misc.md +23 -0
- data/docs/props.md +187 -0
- data/docs/react.md +183 -0
- data/docs/target.md +22 -0
- data/docs/testing.md +147 -0
- data/docs/troubleshooting.md +3 -5
- data/docs/typescript.md +190 -0
- data/docs/v4-upgrade.md +142 -0
- data/docs/webpack-dev-server.md +94 -0
- data/docs/webpack.md +315 -0
- data/docs/yarn.md +23 -0
- data/lib/install/config/webpacker.yml +2 -4
- data/lib/install/examples/vue3/app.vue +27 -0
- data/lib/install/examples/vue3/hello_vue.js +15 -0
- data/lib/install/javascript/packs/application.css +9 -0
- data/lib/install/{packs/entrypoints → javascript/packs}/application.js +2 -4
- data/lib/install/template.rb +3 -3
- data/lib/webpacker/commands.rb +1 -2
- data/lib/webpacker/compiler.rb +3 -9
- data/lib/webpacker/dev_server_runner.rb +0 -2
- data/lib/webpacker/helper.rb +43 -13
- data/lib/webpacker/manifest.rb +1 -1
- data/lib/webpacker/version.rb +1 -1
- data/lib/webpacker/webpack_runner.rb +0 -1
- data/package.json +1 -1
- data/package/__tests__/development.js +1 -2
- data/package/babel/preset-react.js +62 -0
- data/package/babel/preset.js +13 -24
- data/package/environments/__tests__/base.js +5 -5
- data/package/environments/base.js +19 -19
- data/package/environments/development.js +0 -1
- data/package/environments/production.js +30 -28
- data/package/index.js +2 -7
- data/package/rules/babel.js +1 -1
- data/package/rules/coffee.js +5 -5
- data/package/rules/erb.js +3 -5
- data/package/rules/file.js +3 -5
- data/package/rules/index.js +17 -9
- data/package/rules/less.js +10 -14
- data/package/rules/sass.js +9 -13
- data/package/rules/svg.js +23 -0
- data/package/utils/get_style_rule.js +31 -27
- data/package/utils/helpers.js +0 -25
- data/test/configuration_test.rb +2 -2
- data/test/dev_server_runner_test.rb +2 -10
- data/test/helper_test.rb +39 -33
- data/test/manifest_test.rb +0 -8
- data/test/mounted_app/test/dummy/config/webpacker.yml +2 -2
- data/test/test_app/app/{packs/entrypoints → javascript/packs}/application.js +1 -1
- data/test/test_app/app/{packs/entrypoints → javascript/packs}/multi_entry.css +0 -0
- data/test/test_app/app/{packs/entrypoints → javascript/packs}/multi_entry.js +0 -0
- data/test/test_app/config/webpacker.yml +2 -2
- data/test/test_app/public/packs/manifest.json +0 -7
- metadata +36 -17
- data/6_0_upgrade.md +0 -62
- data/config/README.md +0 -3
- data/config/webpacker.yml +0 -1
- data/package/__tests__/index.js +0 -9
- data/package/rules/raw.js +0 -5
- data/package/rules/stylus.js +0 -26
data/package/utils/helpers.js
CHANGED
@@ -16,36 +16,11 @@ const resetEnv = () => {
|
|
16
16
|
|
17
17
|
const ensureTrailingSlash = (path) => (path.endsWith('/') ? path : `${path}/`)
|
18
18
|
|
19
|
-
const resolvedPath = (packageName) => {
|
20
|
-
try {
|
21
|
-
return require.resolve(packageName)
|
22
|
-
} catch (e) {
|
23
|
-
if (e.code !== 'MODULE_NOT_FOUND') {
|
24
|
-
throw e
|
25
|
-
}
|
26
|
-
return null
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
const moduleExists = (packageName) => (!!resolvedPath(packageName))
|
31
|
-
|
32
|
-
const canProcess = (rule, fn) => {
|
33
|
-
const modulePath = resolvedPath(rule)
|
34
|
-
|
35
|
-
if (modulePath) {
|
36
|
-
return fn(modulePath)
|
37
|
-
}
|
38
|
-
|
39
|
-
return null
|
40
|
-
}
|
41
|
-
|
42
19
|
module.exports = {
|
43
20
|
chdirTestApp,
|
44
21
|
chdirCwd,
|
45
22
|
isArray,
|
46
23
|
isBoolean,
|
47
24
|
ensureTrailingSlash,
|
48
|
-
canProcess,
|
49
|
-
moduleExists,
|
50
25
|
resetEnv
|
51
26
|
}
|
data/test/configuration_test.rb
CHANGED
@@ -10,12 +10,12 @@ class ConfigurationTest < Webpacker::Test
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_source_path
|
13
|
-
source_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/
|
13
|
+
source_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/javascript").to_s
|
14
14
|
assert_equal source_path, @config.source_path.to_s
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_source_entry_path
|
18
|
-
source_entry_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/
|
18
|
+
source_entry_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/javascript", "packs").to_s
|
19
19
|
assert_equal @config.source_entry_path.to_s, source_entry_path
|
20
20
|
end
|
21
21
|
|
@@ -43,27 +43,19 @@ class DevServerRunnerTest < Webpacker::Test
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
def test_environment_variables
|
47
|
-
cmd = ["#{test_app_path}/node_modules/.bin/webpack", "serve", "--config", "#{test_app_path}/config/webpack/development.js"]
|
48
|
-
env = Webpacker::Compiler.env.dup
|
49
|
-
env["WEBPACKER_CONFIG"] = "#{test_app_path}/config/webpacker.yml"
|
50
|
-
env["WEBPACK_DEV_SERVER"] = "true"
|
51
|
-
verify_command(cmd, env: env)
|
52
|
-
end
|
53
|
-
|
54
46
|
private
|
55
47
|
def test_app_path
|
56
48
|
File.expand_path("test_app", __dir__)
|
57
49
|
end
|
58
50
|
|
59
|
-
def verify_command(cmd, use_node_modules: true, argv: []
|
51
|
+
def verify_command(cmd, use_node_modules: true, argv: [])
|
60
52
|
cwd = Dir.pwd
|
61
53
|
Dir.chdir(test_app_path)
|
62
54
|
|
63
55
|
klass = Webpacker::DevServerRunner
|
64
56
|
instance = klass.new(argv)
|
65
57
|
mock = Minitest::Mock.new
|
66
|
-
mock.expect(:call, nil, [env, *cmd])
|
58
|
+
mock.expect(:call, nil, [Webpacker::Compiler.env, *cmd])
|
67
59
|
|
68
60
|
klass.stub(:new, instance) do
|
69
61
|
instance.stub(:node_modules_bin_exist?, use_node_modules) do
|
data/test/helper_test.rb
CHANGED
@@ -79,6 +79,33 @@ class HelperTest < ActionView::TestCase
|
|
79
79
|
favicon_pack_tag("media/images/nested/mb-icon.png", rel: "apple-touch-icon", type: "image/png")
|
80
80
|
end
|
81
81
|
|
82
|
+
def test_javascript_pack_tag
|
83
|
+
assert_equal \
|
84
|
+
%(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js"></script>),
|
85
|
+
javascript_pack_tag("bootstrap.js")
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_javascript_pack_tag_symbol
|
89
|
+
assert_equal \
|
90
|
+
%(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js"></script>),
|
91
|
+
javascript_pack_tag(:bootstrap)
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_javascript_pack_tag_splat
|
95
|
+
assert_equal \
|
96
|
+
%(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js" defer="defer"></script>\n) +
|
97
|
+
%(<script src="/packs/application-k344a6d59eef8632c9d1.js" defer="defer"></script>),
|
98
|
+
javascript_pack_tag("bootstrap.js", "application.js", defer: true)
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_javascript_pack_tag_split_chunks
|
102
|
+
assert_equal \
|
103
|
+
%(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js"></script>\n) +
|
104
|
+
%(<script src="/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js"></script>\n) +
|
105
|
+
%(<script src="/packs/application-k344a6d59eef8632c9d1.js"></script>),
|
106
|
+
javascript_packs_with_chunks_tag("application")
|
107
|
+
end
|
108
|
+
|
82
109
|
def test_preload_pack_asset
|
83
110
|
if self.class.method_defined?(:preload_link_tag)
|
84
111
|
assert_equal \
|
@@ -95,51 +122,30 @@ class HelperTest < ActionView::TestCase
|
|
95
122
|
end
|
96
123
|
end
|
97
124
|
|
98
|
-
def
|
125
|
+
def test_stylesheet_pack_tag_split_chunks
|
99
126
|
assert_equal \
|
100
|
-
%(<
|
101
|
-
%(<
|
102
|
-
%(<
|
103
|
-
|
104
|
-
javascript_pack_tag("application", "bootstrap")
|
105
|
-
end
|
106
|
-
|
107
|
-
def test_javascript_pack_tag_splat
|
108
|
-
assert_equal \
|
109
|
-
%(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js" defer="defer"></script>\n) +
|
110
|
-
%(<script src="/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js" defer="defer"></script>\n) +
|
111
|
-
%(<script src="/packs/application-k344a6d59eef8632c9d1.js" defer="defer"></script>),
|
112
|
-
javascript_pack_tag("application", defer: true)
|
113
|
-
end
|
114
|
-
|
115
|
-
def test_javascript_pack_tag_symbol
|
116
|
-
assert_equal \
|
117
|
-
%(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js"></script>\n) +
|
118
|
-
%(<script src="/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js"></script>\n) +
|
119
|
-
%(<script src="/packs/application-k344a6d59eef8632c9d1.js"></script>),
|
120
|
-
javascript_pack_tag(:application)
|
127
|
+
%(<link rel="stylesheet" media="screen" href="/packs/1-c20632e7baf2c81200d3.chunk.css" />\n) +
|
128
|
+
%(<link rel="stylesheet" media="screen" href="/packs/application-k344a6d59eef8632c9d1.chunk.css" />\n) +
|
129
|
+
%(<link rel="stylesheet" media="screen" href="/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css" />),
|
130
|
+
stylesheet_packs_with_chunks_tag("application", "hello_stimulus")
|
121
131
|
end
|
122
132
|
|
123
133
|
def test_stylesheet_pack_tag
|
124
134
|
assert_equal \
|
125
|
-
%(<link rel="stylesheet" media="screen" href="/packs/
|
126
|
-
|
127
|
-
%(<link rel="stylesheet" media="screen" href="/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css" />),
|
128
|
-
stylesheet_pack_tag("application", "hello_stimulus")
|
135
|
+
%(<link rel="stylesheet" media="screen" href="/packs/bootstrap-c38deda30895059837cf.css" />),
|
136
|
+
stylesheet_pack_tag("bootstrap.css")
|
129
137
|
end
|
130
138
|
|
131
139
|
def test_stylesheet_pack_tag_symbol
|
132
140
|
assert_equal \
|
133
|
-
%(<link rel="stylesheet" media="screen" href="/packs/
|
134
|
-
|
135
|
-
%(<link rel="stylesheet" media="screen" href="/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css" />),
|
136
|
-
stylesheet_pack_tag(:application, :hello_stimulus)
|
141
|
+
%(<link rel="stylesheet" media="screen" href="/packs/bootstrap-c38deda30895059837cf.css" />),
|
142
|
+
stylesheet_pack_tag(:bootstrap)
|
137
143
|
end
|
138
144
|
|
139
145
|
def test_stylesheet_pack_tag_splat
|
140
146
|
assert_equal \
|
141
|
-
%(<link rel="stylesheet" media="all" href="/packs/
|
142
|
-
%(<link rel="stylesheet" media="all" href="/packs/application-
|
143
|
-
stylesheet_pack_tag("application", media: "all")
|
147
|
+
%(<link rel="stylesheet" media="all" href="/packs/bootstrap-c38deda30895059837cf.css" />\n) +
|
148
|
+
%(<link rel="stylesheet" media="all" href="/packs/application-dd6b1cd38bfa093df600.css" />),
|
149
|
+
stylesheet_pack_tag("bootstrap.css", "application.css", media: "all")
|
144
150
|
end
|
145
151
|
end
|
data/test/manifest_test.rb
CHANGED
@@ -25,14 +25,6 @@ class ManifestTest < Minitest::Test
|
|
25
25
|
assert_equal Webpacker.manifest.lookup!("bootstrap.js"), "/packs/bootstrap-300631c4f0e0f9c865bc.js"
|
26
26
|
end
|
27
27
|
|
28
|
-
def test_lookup_with_chunks_without_extension_success!
|
29
|
-
assert_equal Webpacker.manifest.lookup_pack_with_chunks!("bootstrap", type: :javascript), ["/packs/bootstrap-300631c4f0e0f9c865bc.js"]
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_lookup_with_chunks_with_extension_success!
|
33
|
-
assert_equal Webpacker.manifest.lookup_pack_with_chunks!("bootstrap.js", type: :javascript), ["/packs/bootstrap-300631c4f0e0f9c865bc.js"]
|
34
|
-
end
|
35
|
-
|
36
28
|
def test_lookup_nil
|
37
29
|
assert_nil Webpacker.manifest.lookup("foo.js")
|
38
30
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
2
2
|
|
3
3
|
default: &default
|
4
|
-
source_path: app/
|
5
|
-
source_entry_path:
|
4
|
+
source_path: app/javascript
|
5
|
+
source_entry_path: packs
|
6
6
|
public_output_path: packs
|
7
7
|
cache_path: tmp/cache/webpacker
|
8
8
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* eslint no-console:0 */
|
2
2
|
// This file is automatically compiled by Webpack, along with any other files
|
3
3
|
// present in this directory. You're encouraged to place your actual application logic in
|
4
|
-
// a relevant structure within app/
|
4
|
+
// a relevant structure within app/javascript and only use these pack files to reference
|
5
5
|
// that code so it'll be compiled.
|
6
6
|
//
|
7
7
|
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
|
File without changes
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
2
2
|
|
3
3
|
default: &default
|
4
|
-
source_path: app/
|
5
|
-
source_entry_path:
|
4
|
+
source_path: app/javascript
|
5
|
+
source_entry_path: packs
|
6
6
|
public_root_path: public
|
7
7
|
public_output_path: packs
|
8
8
|
cache_path: tmp/cache/webpacker
|
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: 6.0.0.
|
4
|
+
version: 6.0.0.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -126,7 +126,6 @@ files:
|
|
126
126
|
- ".gitignore"
|
127
127
|
- ".node-version"
|
128
128
|
- ".rubocop.yml"
|
129
|
-
- 6_0_upgrade.md
|
130
129
|
- CHANGELOG.md
|
131
130
|
- CONTRIBUTING.md
|
132
131
|
- Gemfile
|
@@ -134,9 +133,27 @@ files:
|
|
134
133
|
- MIT-LICENSE
|
135
134
|
- README.md
|
136
135
|
- Rakefile
|
137
|
-
-
|
138
|
-
-
|
136
|
+
- docs/assets.md
|
137
|
+
- docs/cloud9.md
|
138
|
+
- docs/css.md
|
139
|
+
- docs/deployment.md
|
140
|
+
- docs/docker.md
|
141
|
+
- docs/engines.md
|
142
|
+
- docs/env.md
|
143
|
+
- docs/es6.md
|
144
|
+
- docs/folder-structure.md
|
145
|
+
- docs/integrations.md
|
146
|
+
- docs/misc.md
|
147
|
+
- docs/props.md
|
148
|
+
- docs/react.md
|
149
|
+
- docs/target.md
|
150
|
+
- docs/testing.md
|
139
151
|
- docs/troubleshooting.md
|
152
|
+
- docs/typescript.md
|
153
|
+
- docs/v4-upgrade.md
|
154
|
+
- docs/webpack-dev-server.md
|
155
|
+
- docs/webpack.md
|
156
|
+
- docs/yarn.md
|
140
157
|
- gemfiles/Gemfile-rails-edge
|
141
158
|
- gemfiles/Gemfile-rails.5.2.x
|
142
159
|
- gemfiles/Gemfile-rails.6.0.x
|
@@ -148,7 +165,10 @@ files:
|
|
148
165
|
- lib/install/config/webpack/production.js
|
149
166
|
- lib/install/config/webpack/test.js
|
150
167
|
- lib/install/config/webpacker.yml
|
151
|
-
- lib/install/
|
168
|
+
- lib/install/examples/vue3/app.vue
|
169
|
+
- lib/install/examples/vue3/hello_vue.js
|
170
|
+
- lib/install/javascript/packs/application.css
|
171
|
+
- lib/install/javascript/packs/application.js
|
152
172
|
- lib/install/template.rb
|
153
173
|
- lib/tasks/webpacker.rake
|
154
174
|
- lib/tasks/webpacker/binstubs.rake
|
@@ -182,10 +202,10 @@ files:
|
|
182
202
|
- package/__tests__/dev_server.js
|
183
203
|
- package/__tests__/development.js
|
184
204
|
- package/__tests__/env.js
|
185
|
-
- package/__tests__/index.js
|
186
205
|
- package/__tests__/production.js
|
187
206
|
- package/__tests__/staging.js
|
188
207
|
- package/__tests__/test.js
|
208
|
+
- package/babel/preset-react.js
|
189
209
|
- package/babel/preset.js
|
190
210
|
- package/config.js
|
191
211
|
- package/configPath.js
|
@@ -204,9 +224,8 @@ files:
|
|
204
224
|
- package/rules/file.js
|
205
225
|
- package/rules/index.js
|
206
226
|
- package/rules/less.js
|
207
|
-
- package/rules/raw.js
|
208
227
|
- package/rules/sass.js
|
209
|
-
- package/rules/
|
228
|
+
- package/rules/svg.js
|
210
229
|
- package/utils/get_style_rule.js
|
211
230
|
- package/utils/helpers.js
|
212
231
|
- test/command_test.rb
|
@@ -229,9 +248,9 @@ files:
|
|
229
248
|
- test/mounted_app/test/dummy/package.json
|
230
249
|
- test/rake_tasks_test.rb
|
231
250
|
- test/test_app/Rakefile
|
232
|
-
- test/test_app/app/packs/
|
233
|
-
- test/test_app/app/packs/
|
234
|
-
- test/test_app/app/packs/
|
251
|
+
- test/test_app/app/javascript/packs/application.js
|
252
|
+
- test/test_app/app/javascript/packs/multi_entry.css
|
253
|
+
- test/test_app/app/javascript/packs/multi_entry.js
|
235
254
|
- test/test_app/bin/webpack
|
236
255
|
- test/test_app/bin/webpack-dev-server
|
237
256
|
- test/test_app/config.ru
|
@@ -253,8 +272,8 @@ homepage: https://github.com/rails/webpacker
|
|
253
272
|
licenses:
|
254
273
|
- MIT
|
255
274
|
metadata:
|
256
|
-
source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.
|
257
|
-
changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.
|
275
|
+
source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.pre.1
|
276
|
+
changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.pre.1/CHANGELOG.md
|
258
277
|
post_install_message:
|
259
278
|
rdoc_options: []
|
260
279
|
require_paths:
|
@@ -295,9 +314,9 @@ test_files:
|
|
295
314
|
- test/mounted_app/test/dummy/package.json
|
296
315
|
- test/rake_tasks_test.rb
|
297
316
|
- test/test_app/Rakefile
|
298
|
-
- test/test_app/app/packs/
|
299
|
-
- test/test_app/app/packs/
|
300
|
-
- test/test_app/app/packs/
|
317
|
+
- test/test_app/app/javascript/packs/application.js
|
318
|
+
- test/test_app/app/javascript/packs/multi_entry.css
|
319
|
+
- test/test_app/app/javascript/packs/multi_entry.js
|
301
320
|
- test/test_app/bin/webpack
|
302
321
|
- test/test_app/bin/webpack-dev-server
|
303
322
|
- test/test_app/config.ru
|
data/6_0_upgrade.md
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
# To webpacker v6 from v5
|
2
|
-
|
3
|
-
This guide aims to help you migrating to webpacker 6. If you are using
|
4
|
-
vanilla webpacker install then hopefully, the upgrade should be really
|
5
|
-
straightforward.
|
6
|
-
|
7
|
-
## Preparation
|
8
|
-
|
9
|
-
1. If your `source_path` is `app/javascript`, rename it to `app/packs`
|
10
|
-
2. If your `source_entry_path` is `packs`, rename it to `entrypoints`
|
11
|
-
3. Rename `config/webpack` to `config/webpack_old`
|
12
|
-
4. Rename `config/webpacker.yml` to `config/webpacker_old.yml`
|
13
|
-
5. Uninstall the current version of `webpack-dev-server`: `yarn remove webpack-dev-server`
|
14
|
-
6. Upgrade webpacker
|
15
|
-
|
16
|
-
```ruby
|
17
|
-
# Gemfile
|
18
|
-
gem 'webpacker', '~> 6.0.0.pre.2'
|
19
|
-
```
|
20
|
-
|
21
|
-
```bash
|
22
|
-
bundle install
|
23
|
-
```
|
24
|
-
|
25
|
-
```bash
|
26
|
-
yarn add @rails/webpacker@next
|
27
|
-
```
|
28
|
-
|
29
|
-
```bash
|
30
|
-
bundle exec rails webpacker:install
|
31
|
-
```
|
32
|
-
|
33
|
-
- Change `javascript_packs_with_chunks_tag` and `stylesheet_packs_with_chunks_tag` to `javascript_pack_tag` and
|
34
|
-
`stylesheet_pack_tag`.
|
35
|
-
|
36
|
-
7. If you are using any integrations like `css`, `React` or `TypeScript`. Please see https://github.com/rails/webpacker#integrations section on how they work in v6.0.
|
37
|
-
|
38
|
-
8. Copy over any custom webpack config from `config/webpack_old`
|
39
|
-
|
40
|
-
- Common code previously called 'environment' changed to 'base'
|
41
|
-
- import `environment` changed name to `webpackConfig`.
|
42
|
-
|
43
|
-
```js
|
44
|
-
// config/webpack/base.js
|
45
|
-
const { webpackConfig, merge } = require('@rails/webpacker')
|
46
|
-
const customConfig = require('./custom')
|
47
|
-
|
48
|
-
module.exports = merge(webpackConfig, customConfig)
|
49
|
-
```
|
50
|
-
|
51
|
-
9. Copy over custom browserlist config from `.browserlistrc` if it exists into the `"browserlist"` key in `package.json` and remove `.browserslistrc`.
|
52
|
-
|
53
|
-
10. `extensions` was removed from the webpacker.yml file. Move custom extensions to
|
54
|
-
your configuration by by merging an object like this. For more details, see docs for
|
55
|
-
[Webpack Configuration](https://github.com/rails/webpacker/blob/master/README.md#webpack-configuration)
|
56
|
-
```js
|
57
|
-
{
|
58
|
-
resolve: {
|
59
|
-
extensions: ['.ts', '.tsx']
|
60
|
-
}
|
61
|
-
}
|
62
|
-
```
|
data/config/README.md
DELETED
data/config/webpacker.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
config/lib/install/config/webpacker.yml
|