webpacker 4.0.2 → 4.0.3
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/.gitignore +1 -0
- data/.travis.yml +17 -9
- data/CHANGELOG.md +4 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +55 -64
- data/README.md +10 -14
- data/docs/assets.md +20 -10
- data/docs/css.md +54 -1
- data/docs/deployment.md +16 -0
- data/docs/engines.md +8 -0
- data/docs/es6.md +5 -4
- data/docs/troubleshooting.md +9 -0
- data/docs/v4-upgrade.md +12 -2
- data/docs/webpack.md +3 -4
- data/gemfiles/Gemfile-rails-edge +1 -2
- data/gemfiles/Gemfile-rails.4.2.x +1 -2
- data/gemfiles/Gemfile-rails.5.0.x +1 -2
- data/gemfiles/Gemfile-rails.5.1.x +1 -2
- data/gemfiles/Gemfile-rails.5.2.x +1 -2
- data/lib/install/config/babel.config.js +3 -1
- data/lib/install/config/webpacker.yml +1 -1
- data/lib/install/elm.rb +2 -2
- data/lib/install/examples/react/babel.config.js +1 -0
- data/lib/install/examples/vue/hello_vue.js +2 -3
- data/lib/tasks/webpacker/compile.rake +8 -5
- data/lib/webpacker/compiler.rb +8 -4
- data/lib/webpacker/dev_server_runner.rb +6 -0
- data/lib/webpacker/helper.rb +1 -1
- data/lib/webpacker/version.rb +1 -1
- data/lib/webpacker/webpack_runner.rb +6 -0
- data/package.json +26 -24
- data/package/environments/__tests__/base.js +2 -2
- data/package/environments/base.js +2 -2
- data/package/rules/node_modules.js +1 -1
- data/webpacker.gemspec +2 -1
- data/yarn.lock +1335 -1103
- metadata +29 -10
    
        data/docs/deployment.md
    CHANGED
    
    | @@ -83,3 +83,19 @@ Make sure you have `public/packs` and `node_modules` in `:linked_dirs` | |
| 83 83 | 
             
            append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/packs", ".bundle", "node_modules"
         | 
| 84 84 | 
             
            ```
         | 
| 85 85 |  | 
| 86 | 
            +
            If you have `node_modules` added to `:linked_dirs` you'll need to run yarn install before `deploy:assets:precompile`, so you can add this code snippet at the bottom deploy.rb
         | 
| 87 | 
            +
             | 
| 88 | 
            +
            ```ruby
         | 
| 89 | 
            +
            before "deploy:assets:precompile", "deploy:yarn_install"
         | 
| 90 | 
            +
            namespace :deploy do
         | 
| 91 | 
            +
              desc "Run rake yarn install"
         | 
| 92 | 
            +
              task :yarn_install do
         | 
| 93 | 
            +
                on roles(:web) do
         | 
| 94 | 
            +
                  within release_path do
         | 
| 95 | 
            +
                    execute("cd #{release_path} && yarn install --silent --no-progress --no-audit --no-optional")
         | 
| 96 | 
            +
                  end
         | 
| 97 | 
            +
                end
         | 
| 98 | 
            +
              end
         | 
| 99 | 
            +
            end
         | 
| 100 | 
            +
            ```
         | 
| 101 | 
            +
             | 
    
        data/docs/engines.md
    CHANGED
    
    | @@ -21,6 +21,8 @@ There is no built-in tasks to install Webpacker within the engine, thus you have | |
| 21 21 |  | 
| 22 22 | 
             
            ## Step 3: configure Webpacker instance.
         | 
| 23 23 |  | 
| 24 | 
            +
            - File `lib/my_engine.rb`
         | 
| 25 | 
            +
             | 
| 24 26 | 
             
            ```ruby
         | 
| 25 27 | 
             
            module MyEngine
         | 
| 26 28 | 
             
              ROOT_PATH = Pathname.new(File.join(__dir__, ".."))
         | 
| @@ -38,6 +40,8 @@ end | |
| 38 40 |  | 
| 39 41 | 
             
            ## Step 4: Configure dev server proxy.
         | 
| 40 42 |  | 
| 43 | 
            +
            - File `lib/my_engine/engine.rb`
         | 
| 44 | 
            +
             | 
| 41 45 | 
             
            ```ruby
         | 
| 42 46 | 
             
            module MyEngine
         | 
| 43 47 | 
             
              class Engine < ::Rails::Engine
         | 
| @@ -73,6 +77,8 @@ development: | |
| 73 77 |  | 
| 74 78 | 
             
            ## Step 5: configure helper.
         | 
| 75 79 |  | 
| 80 | 
            +
            - File `app/helpers/my_engine/application_helper.rb`
         | 
| 81 | 
            +
             | 
| 76 82 | 
             
            ```ruby
         | 
| 77 83 | 
             
            require "webpacker/helper"
         | 
| 78 84 |  | 
| @@ -93,6 +99,8 @@ Now you can use `stylesheet_pack_tag` and `javascript_pack_tag` from within your | |
| 93 99 |  | 
| 94 100 | 
             
            Add Rake task to compile assets in production (`rake my_engine:webpacker:compile`)
         | 
| 95 101 |  | 
| 102 | 
            +
            - File `lib/tasks/my_engine_tasks.rake`
         | 
| 103 | 
            +
             | 
| 96 104 | 
             
            ```ruby
         | 
| 97 105 | 
             
            namespace :my_engine do
         | 
| 98 106 | 
             
              namespace :webpacker do
         | 
    
        data/docs/es6.md
    CHANGED
    
    | @@ -16,13 +16,14 @@ Following ES6/7 features are supported out of the box: | |
| 16 16 | 
             
            * Dynamic import() - useful for route level code-splitting
         | 
| 17 17 | 
             
            * Class Fields and Static Properties.
         | 
| 18 18 |  | 
| 19 | 
            -
            We have also included [ | 
| 20 | 
            -
             | 
| 19 | 
            +
            We have also included [core-js](https://github.com/zloirock/core-js) to polyfill features in the
         | 
| 20 | 
            +
            older browsers.
         | 
| 21 21 |  | 
| 22 | 
            -
            Don't forget to  | 
| 22 | 
            +
            Don't forget to add these lines into your main entry point:
         | 
| 23 23 |  | 
| 24 24 | 
             
            ```js
         | 
| 25 | 
            -
            import " | 
| 25 | 
            +
            import "core-js/stable";
         | 
| 26 | 
            +
            import "regenerator-runtime/runtime";
         | 
| 26 27 | 
             
            ```
         | 
| 27 28 |  | 
| 28 29 |  | 
    
        data/docs/troubleshooting.md
    CHANGED
    
    | @@ -1,5 +1,14 @@ | |
| 1 1 | 
             
            # Troubleshooting
         | 
| 2 2 |  | 
| 3 | 
            +
            ## Debugging your webpack config
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            1. Read the error message carefully. The error message will tell you the precise key value
         | 
| 6 | 
            +
               that is not matching what Webpack expects.
         | 
| 7 | 
            +
            2. Put a `debugger` statement in your Webpack configuration and run `bin/webpack --debug`. 
         | 
| 8 | 
            +
               If you have a node debugger installed, you'll see the Chrome debugger for your webpack
         | 
| 9 | 
            +
               config. For example, install the Chrome extension [NiM](https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj) and 
         | 
| 10 | 
            +
               set the option for the dev tools to open automatically. For more details on debugging,
         | 
| 11 | 
            +
               see the official [Webpack docs on debugging](https://webpack.js.org/contribute/debugging/#devtools)
         | 
| 3 12 |  | 
| 4 13 | 
             
            ## ENOENT: no such file or directory - node-sass
         | 
| 5 14 |  | 
    
        data/docs/v4-upgrade.md
    CHANGED
    
    | @@ -5,7 +5,7 @@ To update a Webpacker v3.5 app to v4, follow these steps: | |
| 5 5 |  | 
| 6 6 | 
             
            1. Update the `webpacker` gem and the `@rails/webpacker` package to v4. This will upgrade Webpack itself from 3.x to 4.x, make sure you're aware of [any deprecations which might effect you](https://webpack.js.org/migrate/4/). Also make sure any other packages you depend on support Webpack 4 and don't require any changes, e.g. if you explicitly include `webpack` you need to upgrade it to 4.x, and if you use `webpack-dev-server` you need to upgrade it to 3.x.
         | 
| 7 7 |  | 
| 8 | 
            -
            2. Browser support definitions have been moved  | 
| 8 | 
            +
            2. Browser support definitions have been moved from [`.browserslistrc`](../lib/install/config/.browserslistrc) to `/`.
         | 
| 9 9 |  | 
| 10 10 | 
             
            3. Merge any differences between [`config/webpacker.yml`](../lib/install/config/webpacker.yml) and your `config/webpacker.yml`.
         | 
| 11 11 |  | 
| @@ -104,7 +104,7 @@ If you want to keep the old behavior source maps can be disabled in any environm | |
| 104 104 | 
             
            // config/webpack/production.js
         | 
| 105 105 |  | 
| 106 106 | 
             
            const environment = require('./environment')
         | 
| 107 | 
            -
            environment.config.merge({ devtool:  | 
| 107 | 
            +
            environment.config.merge({ devtool: false })
         | 
| 108 108 |  | 
| 109 109 | 
             
            module.exports = environment.toWebpackConfig()
         | 
| 110 110 | 
             
            ```
         | 
| @@ -125,6 +125,16 @@ The compiled packs in the public directory are now stored under namespaces: | |
| 125 125 | 
             
            "runtime~hello_react" => "/packs/js/runtime~hello_react-da2baf7fd07b0e8b6d17.js"
         | 
| 126 126 | 
             
            ```
         | 
| 127 127 |  | 
| 128 | 
            +
            ## Upgrading projects with custom Webpack setups that use only the view helpers
         | 
| 129 | 
            +
            The default value for `extract_css` is **false** in `config/webpack.yml`. Custom webpack builds that extract the CSS such as often used with [React on Rails](https://github.com/shakacode/react_on_rails) should set this value to true or else no CSS link tags are generated.
         | 
| 130 | 
            +
             | 
| 131 | 
            +
              ```yml
         | 
| 132 | 
            +
              default: &default
         | 
| 133 | 
            +
                 # other stuff
         | 
| 134 | 
            +
                 extract_css: true
         | 
| 135 | 
            +
                 # by default, extract and emit a css file. The default is false
         | 
| 136 | 
            +
              ```
         | 
| 137 | 
            +
             | 
| 128 138 | 
             
            ## Example Upgrades
         | 
| 129 139 |  | 
| 130 140 | 
             
            This is what an upgrade to Webpacker 4 looked like for existing Rails apps (please contribute yours!):
         | 
    
        data/docs/webpack.md
    CHANGED
    
    | @@ -146,7 +146,7 @@ environment.loaders.insert('svg', { | |
| 146 146 | 
             
                  }
         | 
| 147 147 | 
             
                }
         | 
| 148 148 | 
             
              ])
         | 
| 149 | 
            -
            }, {  | 
| 149 | 
            +
            }, { before: 'file' })
         | 
| 150 150 |  | 
| 151 151 | 
             
            const fileLoader = environment.loaders.get('file')
         | 
| 152 152 | 
             
            fileLoader.exclude = /\.(svg)$/i
         | 
| @@ -221,7 +221,7 @@ const webpack = require('webpack') | |
| 221 221 |  | 
| 222 222 | 
             
            // Get a pre-configured plugin
         | 
| 223 223 | 
             
            const manifestPlugin = environment.plugins.get('Manifest')
         | 
| 224 | 
            -
            manifestPlugin. | 
| 224 | 
            +
            manifestPlugin.options.writeToFileEmit = false
         | 
| 225 225 |  | 
| 226 226 | 
             
            // Add an additional plugin of your choosing : ProvidePlugin
         | 
| 227 227 | 
             
            environment.plugins.prepend(
         | 
| @@ -261,7 +261,7 @@ environment.resolvedModules.append('vendor', 'vendor') | |
| 261 261 | 
             
            ```
         | 
| 262 262 |  | 
| 263 263 | 
             
            ### Add SplitChunks (Webpack V4)
         | 
| 264 | 
            -
            Originally, chunks (and modules imported inside them) were connected by a parent-child relationship in the internal webpack graph. The CommonsChunkPlugin was used to avoid duplicated dependencies across them, but further optimizations were not possible
         | 
| 264 | 
            +
            Originally, chunks (and modules imported inside them) were connected by a parent-child relationship in the internal webpack graph. The CommonsChunkPlugin was used to avoid duplicated dependencies across them, but further optimizations were not possible.
         | 
| 265 265 |  | 
| 266 266 | 
             
            Since webpack v4, the CommonsChunkPlugin was removed in favor of optimization.splitChunks.
         | 
| 267 267 |  | 
| @@ -269,7 +269,6 @@ For the full configuration options of SplitChunks, see the [Webpack documentatio | |
| 269 269 |  | 
| 270 270 | 
             
            ```js
         | 
| 271 271 | 
             
            // config/webpack/environment.js
         | 
| 272 | 
            -
            const WebpackAssetsManifest = require('webpack-assets-manifest');
         | 
| 273 272 |  | 
| 274 273 | 
             
            // Enable the default config
         | 
| 275 274 | 
             
            environment.splitChunks()
         | 
    
        data/gemfiles/Gemfile-rails-edge
    CHANGED
    
    | @@ -2,12 +2,11 @@ source "https://rubygems.org" | |
| 2 2 |  | 
| 3 3 | 
             
            git_source(:github) { |repo| "https://github.com/#{repo}.git" }
         | 
| 4 4 |  | 
| 5 | 
            -
             | 
| 5 | 
            +
            gemspec path: "../"
         | 
| 6 6 |  | 
| 7 7 | 
             
            gem "rails", github: "rails/rails"
         | 
| 8 8 | 
             
            gem "arel", github: "rails/arel"
         | 
| 9 9 | 
             
            gem "rake", ">= 11.1"
         | 
| 10 | 
            -
            gem "rubocop", git: "https://github.com/rubocop-hq/rubocop.git", require: false
         | 
| 11 10 | 
             
            gem "rack-proxy", require: false
         | 
| 12 11 | 
             
            gem "minitest", "~> 5.0"
         | 
| 13 12 | 
             
            gem "byebug"
         | 
| @@ -1,10 +1,9 @@ | |
| 1 1 | 
             
            source "https://rubygems.org"
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            gemspec path: "../"
         | 
| 4 4 |  | 
| 5 5 | 
             
            gem "rails", "~> 4.2.0"
         | 
| 6 6 | 
             
            gem "rake", ">= 11.1"
         | 
| 7 | 
            -
            gem "rubocop", git: "https://github.com/rubocop-hq/rubocop.git", require: false
         | 
| 8 7 | 
             
            gem "rack-proxy", require: false
         | 
| 9 8 | 
             
            gem "minitest", "~> 5.0"
         | 
| 10 9 | 
             
            gem "byebug"
         | 
| @@ -1,10 +1,9 @@ | |
| 1 1 | 
             
            source "https://rubygems.org"
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            gemspec path: "../"
         | 
| 4 4 |  | 
| 5 5 | 
             
            gem "rails", "~> 5.0.0"
         | 
| 6 6 | 
             
            gem "rake", ">= 11.1"
         | 
| 7 | 
            -
            gem "rubocop", git: "https://github.com/rubocop-hq/rubocop.git", require: false
         | 
| 8 7 | 
             
            gem "rack-proxy", require: false
         | 
| 9 8 | 
             
            gem "minitest", "~> 5.0"
         | 
| 10 9 | 
             
            gem "byebug"
         | 
| @@ -1,10 +1,9 @@ | |
| 1 1 | 
             
            source "https://rubygems.org"
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            gemspec path: "../"
         | 
| 4 4 |  | 
| 5 5 | 
             
            gem "rails", "~> 5.1.0"
         | 
| 6 6 | 
             
            gem "rake", ">= 11.1"
         | 
| 7 | 
            -
            gem "rubocop", git: "https://github.com/rubocop-hq/rubocop.git", require: false
         | 
| 8 7 | 
             
            gem "rack-proxy", require: false
         | 
| 9 8 | 
             
            gem "minitest", "~> 5.0"
         | 
| 10 9 | 
             
            gem "byebug"
         | 
| @@ -1,10 +1,9 @@ | |
| 1 1 | 
             
            source "https://rubygems.org"
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            gemspec path: "../"
         | 
| 4 4 |  | 
| 5 5 | 
             
            gem "rails", "~> 5.2.0"
         | 
| 6 6 | 
             
            gem "rake", ">= 11.1"
         | 
| 7 | 
            -
            gem "rubocop", git: "https://github.com/rubocop-hq/rubocop.git", require: false
         | 
| 8 7 | 
             
            gem "rack-proxy", require: false
         | 
| 9 8 | 
             
            gem "minitest", "~> 5.0"
         | 
| 10 9 | 
             
            gem "byebug"
         | 
| @@ -30,6 +30,7 @@ module.exports = function(api) { | |
| 30 30 | 
             
                    {
         | 
| 31 31 | 
             
                      forceAllTransforms: true,
         | 
| 32 32 | 
             
                      useBuiltIns: 'entry',
         | 
| 33 | 
            +
                      corejs: 3,
         | 
| 33 34 | 
             
                      modules: false,
         | 
| 34 35 | 
             
                      exclude: ['transform-typeof-symbol']
         | 
| 35 36 | 
             
                    }
         | 
| @@ -56,7 +57,8 @@ module.exports = function(api) { | |
| 56 57 | 
             
                    require('@babel/plugin-transform-runtime').default,
         | 
| 57 58 | 
             
                    {
         | 
| 58 59 | 
             
                      helpers: false,
         | 
| 59 | 
            -
                      regenerator: true
         | 
| 60 | 
            +
                      regenerator: true,
         | 
| 61 | 
            +
                      corejs: 3
         | 
| 60 62 | 
             
                    }
         | 
| 61 63 | 
             
                  ],
         | 
| 62 64 | 
             
                  [
         | 
| @@ -52,7 +52,7 @@ development: | |
| 52 52 | 
             
              <<: *default
         | 
| 53 53 | 
             
              compile: true
         | 
| 54 54 |  | 
| 55 | 
            -
              # Verifies that  | 
| 55 | 
            +
              # Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
         | 
| 56 56 | 
             
              check_yarn_integrity: true
         | 
| 57 57 |  | 
| 58 58 | 
             
              # Reference: https://webpack.js.org/configuration/dev-server/
         | 
    
        data/lib/install/elm.rb
    CHANGED
    
    | @@ -24,13 +24,13 @@ say "Installing all Elm dependencies" | |
| 24 24 | 
             
            run "yarn add elm elm-webpack-loader"
         | 
| 25 25 | 
             
            run "yarn add --dev elm-hot-webpack-loader"
         | 
| 26 26 | 
             
            run "yarn run elm init"
         | 
| 27 | 
            -
            run "yarn run elm make"
         | 
| 27 | 
            +
            run "yarn run elm make #{Webpacker.config.source_path}/Main.elm"
         | 
| 28 28 |  | 
| 29 29 | 
             
            say "Updating webpack paths to include .elm file extension"
         | 
| 30 30 | 
             
            insert_into_file Webpacker.config.config_path, "- .elm\n".indent(4), after: /\s+extensions:\n/
         | 
| 31 31 |  | 
| 32 32 | 
             
            say "Updating Elm source location"
         | 
| 33 | 
            -
            gsub_file "elm.json", /\" | 
| 33 | 
            +
            gsub_file "elm.json", /\"src\"\n/,
         | 
| 34 34 | 
             
              %("#{Webpacker.config.source_path.relative_path_from(Rails.root)}"\n)
         | 
| 35 35 |  | 
| 36 36 | 
             
            say "Updating .gitignore to include elm-stuff folder"
         | 
| @@ -9,11 +9,10 @@ import Vue from 'vue' | |
| 9 9 | 
             
            import App from '../app.vue'
         | 
| 10 10 |  | 
| 11 11 | 
             
            document.addEventListener('DOMContentLoaded', () => {
         | 
| 12 | 
            -
              const el = document.body.appendChild(document.createElement('hello'))
         | 
| 13 12 | 
             
              const app = new Vue({
         | 
| 14 | 
            -
                el,
         | 
| 15 13 | 
             
                render: h => h(App)
         | 
| 16 | 
            -
              })
         | 
| 14 | 
            +
              }).$mount()
         | 
| 15 | 
            +
              document.body.appendChild(app.$el)
         | 
| 17 16 |  | 
| 18 17 | 
             
              console.log(app)
         | 
| 19 18 | 
             
            })
         | 
| @@ -40,9 +40,12 @@ namespace :webpacker do | |
| 40 40 | 
             
            end
         | 
| 41 41 |  | 
| 42 42 | 
             
            # Compile packs after we've compiled all other assets during precompilation
         | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 43 | 
            +
            skip_webpacker_precompile = %w(no false n f).include?(ENV["WEBPACKER_PRECOMPILE"])
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            unless skip_webpacker_precompile
         | 
| 46 | 
            +
              if Rake::Task.task_defined?("assets:precompile")
         | 
| 47 | 
            +
                enhance_assets_precompile
         | 
| 48 | 
            +
              else
         | 
| 49 | 
            +
                Rake::Task.define_task("assets:precompile" => ["webpacker:yarn_install", "webpacker:compile"])
         | 
| 50 | 
            +
              end
         | 
| 48 51 | 
             
            end
         | 
    
        data/lib/webpacker/compiler.rb
    CHANGED
    
    | @@ -58,17 +58,21 @@ class Webpacker::Compiler | |
| 58 58 | 
             
                def run_webpack
         | 
| 59 59 | 
             
                  logger.info "Compiling…"
         | 
| 60 60 |  | 
| 61 | 
            -
                  stdout,  | 
| 61 | 
            +
                  stdout, stderr, status = Open3.capture3(
         | 
| 62 62 | 
             
                    webpack_env,
         | 
| 63 63 | 
             
                    "#{RbConfig.ruby} ./bin/webpack",
         | 
| 64 64 | 
             
                    chdir: File.expand_path(config.root_path)
         | 
| 65 65 | 
             
                  )
         | 
| 66 66 |  | 
| 67 | 
            -
                  if  | 
| 67 | 
            +
                  if status.success?
         | 
| 68 68 | 
             
                    logger.info "Compiled all packs in #{config.public_output_path}"
         | 
| 69 | 
            -
                    logger. | 
| 69 | 
            +
                    logger.error "#{stderr}" unless stderr.empty?
         | 
| 70 70 | 
             
                  else
         | 
| 71 | 
            -
                    logger.error "Compilation failed:\n#{ | 
| 71 | 
            +
                    logger.error "Compilation failed:\n#{stderr}"
         | 
| 72 | 
            +
                  end
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                  if config.webpack_compile_output?
         | 
| 75 | 
            +
                    logger.info stdout
         | 
| 72 76 | 
             
                  end
         | 
| 73 77 |  | 
| 74 78 | 
             
                  status.success?
         | 
| @@ -51,6 +51,12 @@ module Webpacker | |
| 51 51 | 
             
                    else
         | 
| 52 52 | 
             
                      ["yarn", "webpack-dev-server"]
         | 
| 53 53 | 
             
                    end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                    if ARGV.include?("--debug")
         | 
| 56 | 
            +
                      cmd = [ "node", "--inspect-brk"] + cmd
         | 
| 57 | 
            +
                      ARGV.delete("--debug")
         | 
| 58 | 
            +
                    end
         | 
| 59 | 
            +
             | 
| 54 60 | 
             
                    cmd += ["--config", @webpack_config]
         | 
| 55 61 | 
             
                    cmd += ["--progress", "--color"] if @pretty
         | 
| 56 62 |  | 
    
        data/lib/webpacker/helper.rb
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            module Webpacker::Helper
         | 
| 2 2 | 
             
              # Returns current Webpacker instance.
         | 
| 3 | 
            -
              # Could be  | 
| 3 | 
            +
              # Could be overridden to use multiple Webpacker
         | 
| 4 4 | 
             
              # configurations within the same app (e.g. with engines)
         | 
| 5 5 | 
             
              def current_webpacker_instance
         | 
| 6 6 | 
             
                Webpacker.instance
         | 
    
        data/lib/webpacker/version.rb
    CHANGED
    
    
    
        data/package.json
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            {
         | 
| 2 2 | 
             
              "name": "@rails/webpacker",
         | 
| 3 | 
            -
              "version": "4.0. | 
| 3 | 
            +
              "version": "4.0.3",
         | 
| 4 4 | 
             
              "description": "Use webpack to manage app-like JavaScript modules in Rails",
         | 
| 5 5 | 
             
              "main": "package/index.js",
         | 
| 6 6 | 
             
              "files": [
         | 
| @@ -12,51 +12,53 @@ | |
| 12 12 | 
             
                "yarn": ">=1.0.0"
         | 
| 13 13 | 
             
              },
         | 
| 14 14 | 
             
              "dependencies": {
         | 
| 15 | 
            -
                "@babel/core": "^7. | 
| 16 | 
            -
                "@babel/plugin-proposal-class-properties": "^7. | 
| 17 | 
            -
                "@babel/plugin-proposal-object-rest-spread": "^7. | 
| 15 | 
            +
                "@babel/core": "^7.4.5",
         | 
| 16 | 
            +
                "@babel/plugin-proposal-class-properties": "^7.4.4",
         | 
| 17 | 
            +
                "@babel/plugin-proposal-object-rest-spread": "^7.4.4",
         | 
| 18 18 | 
             
                "@babel/plugin-syntax-dynamic-import": "^7.2.0",
         | 
| 19 | 
            -
                "@babel/plugin-transform-destructuring": "^7. | 
| 20 | 
            -
                "@babel/plugin-transform-regenerator": "^7. | 
| 21 | 
            -
                "@babel/plugin-transform-runtime": "^7. | 
| 22 | 
            -
                "@babel/ | 
| 23 | 
            -
                "@babel/ | 
| 24 | 
            -
                "@babel/runtime": "^7. | 
| 25 | 
            -
                "babel-loader": "^8.0. | 
| 19 | 
            +
                "@babel/plugin-transform-destructuring": "^7.4.4",
         | 
| 20 | 
            +
                "@babel/plugin-transform-regenerator": "^7.4.5",
         | 
| 21 | 
            +
                "@babel/plugin-transform-runtime": "^7.4.4",
         | 
| 22 | 
            +
                "@babel/preset-env": "^7.4.5",
         | 
| 23 | 
            +
                "@babel/runtime": "^7.4.5",
         | 
| 24 | 
            +
                "@babel/runtime-corejs3": "^7.4.5",
         | 
| 25 | 
            +
                "babel-loader": "^8.0.6",
         | 
| 26 26 | 
             
                "babel-plugin-dynamic-import-node": "^2.2.0",
         | 
| 27 27 | 
             
                "babel-plugin-macros": "^2.5.0",
         | 
| 28 28 | 
             
                "case-sensitive-paths-webpack-plugin": "^2.2.0",
         | 
| 29 29 | 
             
                "compression-webpack-plugin": "^2.0.0",
         | 
| 30 | 
            -
                " | 
| 30 | 
            +
                "core-js": "^3.1.3",
         | 
| 31 | 
            +
                "css-loader": "^2.1.1",
         | 
| 31 32 | 
             
                "file-loader": "^3.0.1",
         | 
| 32 33 | 
             
                "flatted": "^2.0.0",
         | 
| 33 | 
            -
                "glob": "^7.1. | 
| 34 | 
            -
                "js-yaml": "^3. | 
| 35 | 
            -
                "mini-css-extract-plugin": "^0. | 
| 36 | 
            -
                "node-sass": "^4. | 
| 34 | 
            +
                "glob": "^7.1.4",
         | 
| 35 | 
            +
                "js-yaml": "^3.13.1",
         | 
| 36 | 
            +
                "mini-css-extract-plugin": "^0.7.0",
         | 
| 37 | 
            +
                "node-sass": "^4.12.0",
         | 
| 37 38 | 
             
                "optimize-css-assets-webpack-plugin": "^5.0.1",
         | 
| 38 39 | 
             
                "path-complete-extname": "^1.0.0",
         | 
| 39 | 
            -
                "pnp-webpack-plugin": "^1.3 | 
| 40 | 
            +
                "pnp-webpack-plugin": "^1.4.3",
         | 
| 40 41 | 
             
                "postcss-flexbugs-fixes": "^4.1.0",
         | 
| 41 42 | 
             
                "postcss-import": "^12.0.1",
         | 
| 42 43 | 
             
                "postcss-loader": "^3.0.0",
         | 
| 43 44 | 
             
                "postcss-preset-env": "^6.6.0",
         | 
| 44 45 | 
             
                "postcss-safe-parser": "^4.0.1",
         | 
| 46 | 
            +
                "regenerator-runtime": "^0.13.2",
         | 
| 45 47 | 
             
                "sass-loader": "^7.1.0",
         | 
| 46 48 | 
             
                "style-loader": "^0.23.1",
         | 
| 47 | 
            -
                "terser-webpack-plugin": "^1. | 
| 48 | 
            -
                "webpack": "^4. | 
| 49 | 
            +
                "terser-webpack-plugin": "^1.3.0",
         | 
| 50 | 
            +
                "webpack": "^4.32.2",
         | 
| 49 51 | 
             
                "webpack-assets-manifest": "^3.1.1",
         | 
| 50 | 
            -
                "webpack-cli": "^3.2 | 
| 52 | 
            +
                "webpack-cli": "^3.3.2",
         | 
| 51 53 | 
             
                "webpack-sources": "^1.3.0"
         | 
| 52 54 | 
             
              },
         | 
| 53 55 | 
             
              "devDependencies": {
         | 
| 54 | 
            -
                "eslint": "^5. | 
| 56 | 
            +
                "eslint": "^5.16.0",
         | 
| 55 57 | 
             
                "eslint-config-airbnb": "^17.1.0",
         | 
| 56 | 
            -
                "eslint-plugin-import": "^2. | 
| 58 | 
            +
                "eslint-plugin-import": "^2.17.3",
         | 
| 57 59 | 
             
                "eslint-plugin-jsx-a11y": "^6.2.1",
         | 
| 58 | 
            -
                "eslint-plugin-react": "^7. | 
| 59 | 
            -
                "jest": "^24. | 
| 60 | 
            +
                "eslint-plugin-react": "^7.13.0",
         | 
| 61 | 
            +
                "jest": "^24.8.0"
         | 
| 60 62 | 
             
              },
         | 
| 61 63 | 
             
              "jest": {
         | 
| 62 64 | 
             
                "testRegex": "(/__tests__/.*|(\\.|/))\\.jsx?$",
         |