webpacker 3.5.5 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +2 -2
- data/docs/css.md +10 -0
- data/docs/troubleshooting.md +0 -3
- data/lib/install/config/webpacker.yml +2 -1
- data/lib/install/elm.rb +4 -3
- data/lib/install/examples/elm/Main.elm +5 -4
- data/lib/install/examples/elm/hello_elm.js +6 -2
- data/lib/install/loaders/elm.js +3 -4
- data/lib/webpacker.rb +1 -0
- data/lib/webpacker/compiler.rb +2 -5
- data/lib/webpacker/configuration.rb +4 -0
- data/lib/webpacker/version.rb +1 -1
- data/package.json +1 -1
- data/test/test_app/config/webpacker.yml +1 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99d9c3eb9fa58026b2fa47c4c2f43ee0c8d69cb476b1ea4fc1c8615135444d92
|
4
|
+
data.tar.gz: 50c7982498e8955c5eef5877da86599600874abfe976f7a985df591c350df4d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e12e68bf1ebdb90e203d20b90bc7a9664593e9643d3459bf4ff3810bea35e6fc1a9f29a8946a50c6f3765e342b74283edb267715e31154313ccd4c9a22eb458b
|
7
|
+
data.tar.gz: 51f758aebcbd9f443c6eaae1cef267e90c57262a0dc3e17619cf24b84c04286d7891b58325db1646ea00c2b639d3047036227bac321a411b31416ce5702c900e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
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
|
+
## [3.6.0] - 2019-03-06
|
4
|
+
See changes: https://github.com/rails/webpacker/compare/88a253ed42966eb2d5c997435e9396881513bce1...3-x-stable
|
5
|
+
|
6
|
+
|
3
7
|
## [3.5.5] - 2018-07-09
|
4
8
|
See changes: https://github.com/rails/webpacker/compare/e8b197e36c77181ca2e4765c620faea59dcd0351...3-x-stable
|
5
9
|
|
@@ -33,7 +37,7 @@
|
|
33
37
|
### Added
|
34
38
|
- `image_pack_tag` helper [#1400](https://github.com/rails/webpacker/pull/1400)
|
35
39
|
- devserver proxy for custom environments [#1415](https://github.com/rails/webpacker/pull/1415)
|
36
|
-
- Rails webpacker:info task [#1416](https://github.com/rails/webpacker/pull/1416)
|
40
|
+
- Rails webpacker:info task [#1416](https://github.com/rails/webpacker/pull/1416)
|
37
41
|
- Include `RAILS_RELATIVE_URL_ROOT` environment variable in publicPath [#1428](https://github.com/rails/webpacker/pull/1428)
|
38
42
|
|
39
43
|
Complete list of changes: [#1464](https://github.com/rails/webpacker/pull/1464)
|
data/Gemfile.lock
CHANGED
data/docs/css.md
CHANGED
@@ -144,3 +144,13 @@ 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
@@ -117,6 +117,3 @@ environment.plugins.append('ContextReplacement',
|
|
117
117
|
)
|
118
118
|
)
|
119
119
|
```
|
120
|
-
|
121
|
-
## Compilation triggered even when files haven't changed
|
122
|
-
Webpacker compares the modified times (mtimes) of files to see if they have changed & determine whether to recompile on-demand. For CI environments that clone the repository before running tests, the modified times will be set to when the repository was cloned, not when the file was last modified. To prevent unnecessary recompilation on CI, Webpacker watches for the `CI` environment variable, and instead compares the SHA hashes of all files to determine if they've actually changed. You can enable this behavior outside of CI environemnts, or in those that don't set the `CI` env var, by running `CI=true bin/webpack` (or `webpack-dev-server`).
|
@@ -5,6 +5,7 @@ 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
|
8
9
|
|
9
10
|
# Additional paths webpack should lookup modules
|
10
11
|
# ['app/assets', 'engine/foo/app/assets']
|
@@ -48,7 +49,7 @@ development:
|
|
48
49
|
headers:
|
49
50
|
'Access-Control-Allow-Origin': '*'
|
50
51
|
watch_options:
|
51
|
-
ignored:
|
52
|
+
ignored: '**/node_modules/**'
|
52
53
|
|
53
54
|
|
54
55
|
test:
|
data/lib/install/elm.rb
CHANGED
@@ -22,14 +22,15 @@ copy_file "#{__dir__}/examples/elm/Main.elm",
|
|
22
22
|
|
23
23
|
say "Installing all Elm dependencies"
|
24
24
|
run "yarn add elm elm-webpack-loader"
|
25
|
-
run "yarn add --dev elm-hot-loader"
|
26
|
-
run "yarn run elm
|
25
|
+
run "yarn add --dev elm-hot-webpack-loader"
|
26
|
+
run "yarn run elm init"
|
27
|
+
run "yarn run elm make"
|
27
28
|
|
28
29
|
say "Updating webpack paths to include .elm file extension"
|
29
30
|
insert_into_file Webpacker.config.config_path, " - .elm\n", after: /extensions:\n/
|
30
31
|
|
31
32
|
say "Updating Elm source location"
|
32
|
-
gsub_file "elm
|
33
|
+
gsub_file "elm.json", /\"\src\"\n/,
|
33
34
|
%("#{Webpacker.config.source_path.relative_path_from(Rails.root)}"\n)
|
34
35
|
|
35
36
|
say "Updating .gitignore to include elm-stuff folder"
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Main exposing (..)
|
2
2
|
|
3
|
+
import Browser
|
3
4
|
import Html exposing (Html, h1, text)
|
4
5
|
import Html.Attributes exposing (style)
|
5
6
|
|
@@ -21,7 +22,7 @@ view : Model -> Html Message
|
|
21
22
|
view model =
|
22
23
|
-- The inline style is being used for example purposes in order to keep this example simple and
|
23
24
|
-- avoid loading additional resources. Use a proper stylesheet when building your own app.
|
24
|
-
h1 [style
|
25
|
+
h1 [style "display" "flex", style "justify-content" "center"]
|
25
26
|
[text "Hello Elm!"]
|
26
27
|
|
27
28
|
-- MESSAGE
|
@@ -43,11 +44,11 @@ subscriptions model =
|
|
43
44
|
|
44
45
|
-- MAIN
|
45
46
|
|
46
|
-
main : Program
|
47
|
+
main : Program (Maybe {}) Model Message
|
47
48
|
main =
|
48
|
-
|
49
|
+
Browser.element
|
49
50
|
{
|
50
|
-
init = init,
|
51
|
+
init = always init,
|
51
52
|
view = view,
|
52
53
|
update = update,
|
53
54
|
subscriptions = subscriptions
|
@@ -2,11 +2,15 @@
|
|
2
2
|
// head of your layout file, like app/views/layouts/application.html.erb.
|
3
3
|
// It will render "Hello Elm!" within the page.
|
4
4
|
|
5
|
-
import
|
5
|
+
import {
|
6
|
+
Elm
|
7
|
+
} from '../Main'
|
6
8
|
|
7
9
|
document.addEventListener('DOMContentLoaded', () => {
|
8
10
|
const target = document.createElement('div')
|
9
11
|
|
10
12
|
document.body.appendChild(target)
|
11
|
-
Elm.Main.
|
13
|
+
Elm.Main.init({
|
14
|
+
node: target
|
15
|
+
})
|
12
16
|
})
|
data/lib/install/loaders/elm.js
CHANGED
@@ -2,12 +2,11 @@ const { resolve } = require('path')
|
|
2
2
|
|
3
3
|
const isProduction = process.env.NODE_ENV === 'production'
|
4
4
|
const elmSource = resolve(process.cwd())
|
5
|
-
const
|
5
|
+
const elmBinary = `${elmSource}/node_modules/.bin/elm`
|
6
6
|
|
7
|
-
const elmDefaultOptions = { cwd: elmSource,
|
7
|
+
const elmDefaultOptions = { cwd: elmSource, pathToElm: elmBinary }
|
8
8
|
const developmentOptions = Object.assign({}, elmDefaultOptions, {
|
9
9
|
verbose: true,
|
10
|
-
warn: true,
|
11
10
|
debug: true
|
12
11
|
})
|
13
12
|
|
@@ -19,5 +18,5 @@ const elmWebpackLoader = {
|
|
19
18
|
module.exports = {
|
20
19
|
test: /\.elm(\.erb)?$/,
|
21
20
|
exclude: [/elm-stuff/, /node_modules/],
|
22
|
-
use: isProduction ? [elmWebpackLoader] : [{ loader: 'elm-hot-loader' }, elmWebpackLoader]
|
21
|
+
use: isProduction ? [elmWebpackLoader] : [{ loader: 'elm-hot-webpack-loader' }, elmWebpackLoader]
|
23
22
|
}
|
data/lib/webpacker.rb
CHANGED
data/lib/webpacker/compiler.rb
CHANGED
@@ -44,11 +44,7 @@ class Webpacker::Compiler
|
|
44
44
|
|
45
45
|
def watched_files_digest
|
46
46
|
files = Dir[*default_watched_paths, *watched_paths].reject { |f| File.directory?(f) }
|
47
|
-
file_ids =
|
48
|
-
files.sort.map { |f| "#{File.basename(f)}/#{Digest::SHA1.file(f).hexdigest}" }
|
49
|
-
else
|
50
|
-
files.map { |f| "#{File.basename(f)}/#{File.mtime(f).utc.to_i}" }
|
51
|
-
end
|
47
|
+
file_ids = files.sort.map { |f| "#{File.basename(f)}/#{Digest::SHA1.file(f).hexdigest}" }
|
52
48
|
Digest::SHA1.hexdigest(file_ids.join("/"))
|
53
49
|
end
|
54
50
|
|
@@ -68,6 +64,7 @@ class Webpacker::Compiler
|
|
68
64
|
|
69
65
|
if status.success?
|
70
66
|
logger.info "Compiled all packs in #{config.public_output_path}"
|
67
|
+
logger.info stdout if config.webpack_compile_output?
|
71
68
|
else
|
72
69
|
logger.error "Compilation failed:\n#{sterr}\n#{stdout}"
|
73
70
|
end
|
data/lib/webpacker/version.rb
CHANGED
data/package.json
CHANGED
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: 3.
|
4
|
+
version: 3.6.0
|
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: 2019-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -238,8 +238,8 @@ homepage: https://github.com/rails/webpacker
|
|
238
238
|
licenses:
|
239
239
|
- MIT
|
240
240
|
metadata:
|
241
|
-
source_code_uri: https://github.com/rails/webpacker/tree/v3.
|
242
|
-
changelog_uri: https://github.com/rails/webpacker/blob/v3.
|
241
|
+
source_code_uri: https://github.com/rails/webpacker/tree/v3.6.0
|
242
|
+
changelog_uri: https://github.com/rails/webpacker/blob/v3.6.0/CHANGELOG.md
|
243
243
|
post_install_message:
|
244
244
|
rdoc_options: []
|
245
245
|
require_paths:
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
version: '0'
|
257
257
|
requirements: []
|
258
258
|
rubyforge_project:
|
259
|
-
rubygems_version: 2.7.
|
259
|
+
rubygems_version: 2.7.6
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Use webpack to manage app-like JavaScript modules in Rails
|