webpacker 4.0.0.pre.pre.1 → 4.0.0.pre.pre.2
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/CHANGELOG.md +12 -5
- data/Gemfile.lock +1 -1
- data/README.md +6 -0
- data/lib/install/template.rb +1 -1
- data/lib/webpacker/helper.rb +10 -0
- data/lib/webpacker/version.rb +1 -1
- data/package.json +1 -1
- data/test/helper_test.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9ff740a84754003342f8f34b560dca75fd9ee004d61f7b0b52d1c8f087d9f03
|
4
|
+
data.tar.gz: 6faf6c891f003ef0cabefbc370a8937a24464cf92ac4379188ed7fe565048fed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef5e0178b7fd4a788a7c98990277fab1f643ccafa4758dd80ceb448d915ca7df03960beebf6cce82ddcd3bdb0e5e89637100c9bb4043fd8d0a7df65b54c9762a
|
7
|
+
data.tar.gz: b79761d39e022de3374ffd21d5b6a990944713a448e27c14a614e261e259d0321de0e03bfab8135274bb538a4db1a2841f8ec9e3bd2ede002d45a6a925b3d33a
|
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,26 @@
|
|
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.0.0-pre.2] - 2018-04-2
|
4
|
+
|
5
|
+
## Fixed
|
6
|
+
|
7
|
+
- Webpack dev server version in installer
|
8
|
+
|
9
|
+
|
3
10
|
## [4.0.0-pre.1] - 2018-04-2
|
4
11
|
|
5
12
|
Pre-release to try out webpack 4.0 support
|
6
13
|
|
7
|
-
|
14
|
+
### Added
|
8
15
|
- Webpack 4.0 support [#1376](https://github.com/rails/webpacker/pull/1316)
|
9
16
|
|
10
|
-
|
17
|
+
### Fixed
|
11
18
|
- Remove compilation digest file if webpack command fails[#1398](https://github.com/rails/webpacker/issues/1398)
|
12
19
|
|
13
20
|
|
14
21
|
## [3.4.1] - 2018-03-24
|
15
22
|
|
16
|
-
|
23
|
+
### Fixed
|
17
24
|
- Yarn integrity check in development [#1374](https://github.com/rails/webpacker/issues/1374)
|
18
25
|
|
19
26
|
|
@@ -21,7 +28,7 @@ Pre-release to try out webpack 4.0 support
|
|
21
28
|
|
22
29
|
**Please use 3.4.1 instead**
|
23
30
|
|
24
|
-
|
31
|
+
### Added
|
25
32
|
- Support for custom Rails environments [#1359](https://github.com/rails/webpacker/pull/1359)
|
26
33
|
|
27
34
|
*This could break the compilation if you set NODE_ENV to custom environment. Now, NODE_ENV only understands production or development mode*
|
@@ -29,7 +36,7 @@ Pre-release to try out webpack 4.0 support
|
|
29
36
|
|
30
37
|
## [3.3.1] - 2018-03-12
|
31
38
|
|
32
|
-
|
39
|
+
### Fixed
|
33
40
|
|
34
41
|
- Use webpack dev server 2.x until webpacker supports webpack 4.x [#1338](https://github.com/rails/webpacker/issues/1338)
|
35
42
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -85,6 +85,9 @@ 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'
|
88
|
+
|
89
|
+
# OR to try out 4.x pre-release
|
90
|
+
gem 'webpacker', '>= 4.0.x'
|
88
91
|
```
|
89
92
|
|
90
93
|
Finally, run following to install Webpacker:
|
@@ -254,6 +257,9 @@ You can run following commands to upgrade Webpacker to the latest stable version
|
|
254
257
|
bundle update webpacker
|
255
258
|
yarn upgrade @rails/webpacker --latest
|
256
259
|
yarn add webpack-dev-server@^2.11.1
|
260
|
+
|
261
|
+
# Or to install a latest release (including pre-releases)
|
262
|
+
yarn add @rails/webpacker
|
257
263
|
```
|
258
264
|
|
259
265
|
### Yarn Integrity
|
data/lib/install/template.rb
CHANGED
@@ -44,7 +44,7 @@ say "Installing all JavaScript dependencies"
|
|
44
44
|
run "yarn add @rails/webpacker"
|
45
45
|
|
46
46
|
say "Installing dev server for live reloading"
|
47
|
-
run "yarn add --dev webpack-dev-server
|
47
|
+
run "yarn add --dev webpack-dev-server"
|
48
48
|
|
49
49
|
if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR > 1
|
50
50
|
say "You need to allow webpack-dev-server host as allowed origin for connect-src.", :yellow
|
data/lib/webpacker/helper.rb
CHANGED
@@ -33,6 +33,16 @@ module Webpacker::Helper
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
# Creates a image tag that references the named pack file.
|
37
|
+
#
|
38
|
+
# Example:
|
39
|
+
#
|
40
|
+
# <%= image_pack_tag 'application.png', size: '16x10', alt: 'Edit Entry' %>
|
41
|
+
# <img alt='Edit Entry' src='/packs/application-k344a6d59eef8632c9d1.png' width='16' height='10' />
|
42
|
+
def image_pack_tag(name, **options)
|
43
|
+
image_tag(asset_path(Webpacker.manifest.lookup!(name)), **options)
|
44
|
+
end
|
45
|
+
|
36
46
|
# Creates a script tag that references the named pack file, as compiled by webpack per the entries list
|
37
47
|
# in config/webpack/shared.js. By default, this list is auto-generated to match everything in
|
38
48
|
# app/javascript/packs/*.js. In production mode, the digested reference is automatically looked up.
|
data/lib/webpacker/version.rb
CHANGED
data/package.json
CHANGED
data/test/helper_test.rb
CHANGED
@@ -31,6 +31,12 @@ class HelperTest < ActionView::TestCase
|
|
31
31
|
assert_equal "https://example.com/packs/bootstrap-c38deda30895059837cf.css", asset_pack_url("bootstrap.css")
|
32
32
|
end
|
33
33
|
|
34
|
+
def test_image_pack_tag
|
35
|
+
assert_equal \
|
36
|
+
"<img alt=\"Edit Entry\" src=\"/packs/application-k344a6d59eef8632c9d1.png\" width=\"16\" height=\"10\" />",
|
37
|
+
image_pack_tag("application.png", size: "16x10", alt: "Edit Entry")
|
38
|
+
end
|
39
|
+
|
34
40
|
def test_javascript_pack_tag
|
35
41
|
assert_equal \
|
36
42
|
%(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js"></script>),
|