Webpacker v2.0 Release Notes

Release Date: 2017-05-24 // almost 7 years ago
  • ๐Ÿ›  Fixed

    • โšก๏ธ Update .babelrc to fix compilation issues - #306

    • ๐Ÿš… Duplicated asset hosts - #320, #397

    • ๐Ÿš… Missing asset host when defined as a Proc or on ActionController::Base.asset_host directly - #397

    • ๐Ÿš… Incorrect asset host when running webpacker:compile or bin/webpack in development mode - #397

    • โšก๏ธ Update webpacker:compile task to use stdout and stderr for better logging - #395

    • ๐Ÿš… ARGV support for webpack-dev-server - #286

    โž• Added

    • ๐Ÿ‘ Elm support. You can now add Elm support via the following methods:

      • New app: rails new <app> --webpack=elm
      • Within an existing app: rails webpacker:install:elm
    • Support for custom public_output_path paths independent of source_entry_path in config/webpacker.yml. output is also now relative to public/. - #397

    Before (compile to public/packs):

      source_entry_path: packs
      public_output_path: packs
    

    After (compile to public/sweet/js):

      source_entry_path: packs
      public_output_path: sweet/js
    
    {
      "presets": [
        [
          "env",
          {
            "modules": false,
            "targets": {
              "browsers": "> 1%",
              "uglify": true
            },
            "useBuiltIns": true
          }
        ]
      ],
    
      "plugins": [
        "syntax-dynamic-import",
        "transform-class-properties",
        { "spec": true }
      ]
    }
    
    • ๐Ÿ‘ Source-map support for production bundle

    ๐Ÿ’ฅ Breaking Change

    • ๐Ÿ”ง Consolidate and flatten paths.yml and development.server.yml config into one file - config/webpacker.yml - #403. This is a breaking change and requires you to re-install webpacker and cleanup old configuration files.
      bundle update webpacker
      bundle exec rails webpacker:install
    
      # Remove old/unused configuration files
      rm config/webpack/paths.yml
      rm config/webpack/development.server.yml
      rm config/webpack/development.server.js
    

    Warning: For now you also have to add a pattern in .gitignore by hand.

       /public/packs
      +/public/packs-test
       /node_modules