webpacker 6.0.0.beta.5 → 6.0.0.beta.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/6_0_upgrade.md +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +20 -3
- data/lib/install/packs/entrypoints/application.js +1 -1
- data/lib/webpacker/manifest.rb +1 -1
- data/lib/webpacker/version.rb +1 -1
- data/package.json +1 -1
- data/package/rules/babel.js +1 -1
- data/package/rules/stylus.js +1 -1
- data/test/manifest_test.rb +8 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e389b1e654d5e3b6e50adb6a908c94cb1039e978b119f32c49c07813f0733ca
|
4
|
+
data.tar.gz: 4843befc313e31f85996e36ce59c994f8c3842e82034da51872a2a4f8cb0e5d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8238ffb0c0b369bbffdf26766a237ca9ab059989aa79c9fa752fe8f217a79ee2985d00ec52861b7320fe2a5610d5df48941ddb597995bf95c846b381a3f7544d
|
7
|
+
data.tar.gz: ce30d8500790565854a174e2ab67598a4fa7ff90eb67a226fb182861baba8d4bb7446958c0457c9b22aedaf345438f69f6542f52a672a6fa2204882220d5d277
|
data/6_0_upgrade.md
CHANGED
@@ -7,7 +7,7 @@ straightforward.
|
|
7
7
|
## Preparation
|
8
8
|
|
9
9
|
1. If your `source_path` is `app/javascript`, rename it to `app/packs`
|
10
|
-
2. If your `source_entry_path` is `
|
10
|
+
2. If your `source_entry_path` is `packs`, rename it to `entrypoints`
|
11
11
|
3. Rename `config/webpack` to `config/webpack_old`
|
12
12
|
4. Rename `config/webpacker.yml` to `config/webpacker_old.yml`
|
13
13
|
5. Uninstall the current version of `webpack-dev-server`: `yarn remove webpack-dev-server`
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -36,7 +36,6 @@ in which case you may not even need the asset pipeline. This is mostly relevant
|
|
36
36
|
- [Resolved](#resolved)
|
37
37
|
- [Watched](#watched)
|
38
38
|
- [Deployment](#deployment)
|
39
|
-
- [Docs](#docs)
|
40
39
|
- [Contributing](#contributing)
|
41
40
|
- [License](#license)
|
42
41
|
|
@@ -130,11 +129,11 @@ app/packs:
|
|
130
129
|
└── logo.svg
|
131
130
|
```
|
132
131
|
|
133
|
-
You can then link the JavaScript pack in Rails views using the `javascript_pack_tag` helper. If you have styles imported in your pack file, you can link them by using `
|
132
|
+
You can then link the JavaScript pack in Rails views using the `javascript_pack_tag` helper. If you have styles imported in your pack file, you can link them by using `stylesheet_pack_tag`:
|
134
133
|
|
135
134
|
```erb
|
136
135
|
<%= javascript_pack_tag 'application' %>
|
137
|
-
<%=
|
136
|
+
<%= stylesheet_pack_tag 'application' %>
|
138
137
|
```
|
139
138
|
|
140
139
|
If you want to link a static asset for `<img />` tag, you can use the `asset_pack_path` helper:
|
@@ -341,6 +340,24 @@ Add tsconfig.json
|
|
341
340
|
}
|
342
341
|
```
|
343
342
|
|
343
|
+
Babel won’t perform any type-checking on TypeScript code. To optionally use type-checking run:
|
344
|
+
|
345
|
+
```bash
|
346
|
+
yarn add fork-ts-checker-webpack-plugin
|
347
|
+
```
|
348
|
+
|
349
|
+
Then modify the webpack config to use it as a plugin:
|
350
|
+
|
351
|
+
```js
|
352
|
+
// config/webpack/base.js
|
353
|
+
const { webpackConfig, merge } = require("@rails/webpacker");
|
354
|
+
const ForkTSCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
|
355
|
+
|
356
|
+
module.exports = merge(webpackConfig, {
|
357
|
+
plugins: [new ForkTSCheckerWebpackPlugin()],
|
358
|
+
});
|
359
|
+
```
|
360
|
+
|
344
361
|
#### CSS
|
345
362
|
|
346
363
|
To enable CSS support in your application, add following packages:
|
@@ -4,7 +4,7 @@
|
|
4
4
|
// a relevant structure within app/packs and only use these pack files to reference
|
5
5
|
// that code so it'll be compiled.
|
6
6
|
//
|
7
|
-
// To reference this file, add <%=
|
7
|
+
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
|
8
8
|
// layout file, like app/views/layouts/application.html.erb
|
9
9
|
|
10
10
|
// Uncomment to copy all static images under ../images to the output folder and reference
|
data/lib/webpacker/manifest.rb
CHANGED
@@ -92,7 +92,7 @@ class Webpacker::Manifest
|
|
92
92
|
# When the user provides a name with a file extension, we want to try to strip it off.
|
93
93
|
def manifest_name(name, pack_type)
|
94
94
|
return name if File.extname(name.to_s).empty?
|
95
|
-
File.basename(name, pack_type)
|
95
|
+
File.basename(name, ".#{pack_type}")
|
96
96
|
end
|
97
97
|
|
98
98
|
def manifest_type(pack_type)
|
data/lib/webpacker/version.rb
CHANGED
data/package.json
CHANGED
data/package/rules/babel.js
CHANGED
@@ -8,7 +8,7 @@ const {
|
|
8
8
|
const { isProduction } = require('../env')
|
9
9
|
|
10
10
|
module.exports = {
|
11
|
-
test: /\.(js|jsx|mjs|ts|tsx)?(\.erb)?$/,
|
11
|
+
test: /\.(js|jsx|mjs|ts|tsx|coffee)?(\.erb)?$/,
|
12
12
|
include: [sourcePath, ...additionalPaths].map((p) => {
|
13
13
|
try {
|
14
14
|
return realpathSync(p)
|
data/package/rules/stylus.js
CHANGED
data/test/manifest_test.rb
CHANGED
@@ -25,6 +25,14 @@ 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
|
+
|
28
36
|
def test_lookup_nil
|
29
37
|
assert_nil Webpacker.manifest.lookup("foo.js")
|
30
38
|
end
|
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.beta.
|
4
|
+
version: 6.0.0.beta.6
|
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: 2021-02-
|
12
|
+
date: 2021-02-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -253,8 +253,8 @@ homepage: https://github.com/rails/webpacker
|
|
253
253
|
licenses:
|
254
254
|
- MIT
|
255
255
|
metadata:
|
256
|
-
source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.beta.
|
257
|
-
changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.beta.
|
256
|
+
source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.beta.6
|
257
|
+
changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.beta.6/CHANGELOG.md
|
258
258
|
post_install_message:
|
259
259
|
rdoc_options: []
|
260
260
|
require_paths:
|