webpacker-jets 3.2.100

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/.eslintignore +4 -0
  3. data/.eslintrc.js +14 -0
  4. data/.gitignore +6 -0
  5. data/.rubocop.yml +124 -0
  6. data/.travis.yml +32 -0
  7. data/CHANGELOG.md +523 -0
  8. data/Gemfile +13 -0
  9. data/Gemfile.lock +154 -0
  10. data/MIT-LICENSE +20 -0
  11. data/README.md +445 -0
  12. data/Rakefile +12 -0
  13. data/docs/assets.md +106 -0
  14. data/docs/cloud9.md +310 -0
  15. data/docs/css.md +116 -0
  16. data/docs/deployment.md +74 -0
  17. data/docs/docker.md +49 -0
  18. data/docs/env.md +65 -0
  19. data/docs/es6.md +53 -0
  20. data/docs/folder-structure.md +66 -0
  21. data/docs/misc.md +23 -0
  22. data/docs/props.md +223 -0
  23. data/docs/testing.md +128 -0
  24. data/docs/troubleshooting.md +119 -0
  25. data/docs/typescript.md +116 -0
  26. data/docs/webpack-dev-server.md +92 -0
  27. data/docs/webpack.md +297 -0
  28. data/docs/yarn.md +12 -0
  29. data/exe/webpack +8 -0
  30. data/exe/webpack-dev-server +8 -0
  31. data/gemfiles/Gemfile-rails-edge +13 -0
  32. data/gemfiles/Gemfile-rails.4.2.x +10 -0
  33. data/gemfiles/Gemfile-rails.5.0.x +10 -0
  34. data/gemfiles/Gemfile-rails.5.1.x +10 -0
  35. data/lib/install/angular.rb +27 -0
  36. data/lib/install/coffee.rb +22 -0
  37. data/lib/install/config/.babelrc +18 -0
  38. data/lib/install/config/.postcssrc.yml +3 -0
  39. data/lib/install/config/webpack/development.js +3 -0
  40. data/lib/install/config/webpack/environment.js +3 -0
  41. data/lib/install/config/webpack/production.js +3 -0
  42. data/lib/install/config/webpack/staging.js +3 -0
  43. data/lib/install/config/webpack/test.js +3 -0
  44. data/lib/install/config/webpacker.yml +79 -0
  45. data/lib/install/elm.rb +38 -0
  46. data/lib/install/erb.rb +22 -0
  47. data/lib/install/examples/angular/hello_angular.js +7 -0
  48. data/lib/install/examples/angular/hello_angular/app/app.component.ts +9 -0
  49. data/lib/install/examples/angular/hello_angular/app/app.module.ts +16 -0
  50. data/lib/install/examples/angular/hello_angular/index.ts +8 -0
  51. data/lib/install/examples/angular/hello_angular/polyfills.ts +73 -0
  52. data/lib/install/examples/angular/tsconfig.json +19 -0
  53. data/lib/install/examples/coffee/hello_coffee.coffee +4 -0
  54. data/lib/install/examples/elm/Main.elm +54 -0
  55. data/lib/install/examples/elm/hello_elm.js +12 -0
  56. data/lib/install/examples/erb/hello_erb.js.erb +6 -0
  57. data/lib/install/examples/react/.babelrc +6 -0
  58. data/lib/install/examples/react/hello_react.jsx +26 -0
  59. data/lib/install/examples/vue/app.vue +22 -0
  60. data/lib/install/examples/vue/hello_vue.js +70 -0
  61. data/lib/install/javascript/packs/application.js +10 -0
  62. data/lib/install/loaders/coffee.js +6 -0
  63. data/lib/install/loaders/elm.js +23 -0
  64. data/lib/install/loaders/erb.js +11 -0
  65. data/lib/install/loaders/typescript.js +6 -0
  66. data/lib/install/loaders/vue.js +13 -0
  67. data/lib/install/react.rb +28 -0
  68. data/lib/install/template.rb +37 -0
  69. data/lib/install/vue.rb +26 -0
  70. data/lib/tasks/installers.rake +24 -0
  71. data/lib/tasks/webpacker.rake +22 -0
  72. data/lib/tasks/webpacker/check_binstubs.rake +12 -0
  73. data/lib/tasks/webpacker/check_node.rake +24 -0
  74. data/lib/tasks/webpacker/check_yarn.rake +24 -0
  75. data/lib/tasks/webpacker/clobber.rake +16 -0
  76. data/lib/tasks/webpacker/compile.rake +41 -0
  77. data/lib/tasks/webpacker/install.rake +13 -0
  78. data/lib/tasks/webpacker/verify_install.rake +16 -0
  79. data/lib/tasks/webpacker/yarn_install.rake +6 -0
  80. data/lib/webpacker.rb +32 -0
  81. data/lib/webpacker/commands.rb +23 -0
  82. data/lib/webpacker/compiler.rb +88 -0
  83. data/lib/webpacker/configuration.rb +87 -0
  84. data/lib/webpacker/dev_server.rb +61 -0
  85. data/lib/webpacker/dev_server_proxy.rb +26 -0
  86. data/lib/webpacker/dev_server_runner.rb +51 -0
  87. data/lib/webpacker/helper.rb +66 -0
  88. data/lib/webpacker/instance.rb +44 -0
  89. data/lib/webpacker/manifest.rb +75 -0
  90. data/lib/webpacker/railtie.rb +82 -0
  91. data/lib/webpacker/rake_tasks.rb +6 -0
  92. data/lib/webpacker/runner.rb +22 -0
  93. data/lib/webpacker/version.rb +9 -0
  94. data/lib/webpacker/webpack_runner.rb +15 -0
  95. data/package.json +67 -0
  96. data/package/__tests__/environment.js +74 -0
  97. data/package/config.js +34 -0
  98. data/package/config_types/__tests__/config_list.js +123 -0
  99. data/package/config_types/__tests__/config_object.js +43 -0
  100. data/package/config_types/config_list.js +85 -0
  101. data/package/config_types/config_object.js +55 -0
  102. data/package/config_types/index.js +7 -0
  103. data/package/environment.js +116 -0
  104. data/package/environments/development.js +46 -0
  105. data/package/environments/production.js +37 -0
  106. data/package/environments/test.js +3 -0
  107. data/package/index.js +20 -0
  108. data/package/rules/babel.js +13 -0
  109. data/package/rules/css.js +39 -0
  110. data/package/rules/file.js +13 -0
  111. data/package/rules/index.js +11 -0
  112. data/package/rules/sass.js +15 -0
  113. data/package/utils/__tests__/deep_assign.js +11 -0
  114. data/package/utils/__tests__/deep_merge.js +10 -0
  115. data/package/utils/__tests__/objectify.js +9 -0
  116. data/package/utils/deep_assign.js +22 -0
  117. data/package/utils/deep_merge.js +23 -0
  118. data/package/utils/helpers.js +32 -0
  119. data/package/utils/objectify.js +4 -0
  120. data/test/command_test.rb +27 -0
  121. data/test/compiler_test.rb +35 -0
  122. data/test/configuration_test.rb +69 -0
  123. data/test/dev_server_test.rb +24 -0
  124. data/test/helper_test.rb +52 -0
  125. data/test/manifest_test.rb +28 -0
  126. data/test/rake_tasks_test.rb +29 -0
  127. data/test/test_app/Rakefile +3 -0
  128. data/test/test_app/app/javascript/packs/application.js +10 -0
  129. data/test/test_app/config/application.rb +11 -0
  130. data/test/test_app/config/environment.rb +4 -0
  131. data/test/test_app/config/webpacker.yml +65 -0
  132. data/test/test_app/public/packs/manifest.json +6 -0
  133. data/test/test_helper.rb +29 -0
  134. data/webpacker-jets.gemspec +29 -0
  135. data/yarn.lock +5768 -0
  136. metadata +250 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bba74bedf0fdd79363526be7bedd09df55a3b98003ed8904881e6ca3b9531941
4
+ data.tar.gz: 0c8a3a3408168405f2af060e7e4cf8a59c935c36a38c40ec2a3b1b50fa656a31
5
+ SHA512:
6
+ metadata.gz: 337b284305fd2a4ca5020aa5cf463954bc0ceec2a287b614cdc8a34ef2700a23b5e94cf81894fb032c7c90f43b0ab55fe5d497e597a6d11203b7c45965d6b6e9
7
+ data.tar.gz: 128c98bd3117cb03bb8a3ffbbde5e10669bace9147c92d54e228a45e9371f02c0274cea052e433d7d95906376948e179b9c65640a164582a86e1146cb8c79851
data/.eslintignore ADDED
@@ -0,0 +1,4 @@
1
+ lib/*
2
+ node_modules/*
3
+ vendor/*
4
+ **/__tests__/**/*
data/.eslintrc.js ADDED
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ 'extends': 'airbnb',
3
+ 'rules': {
4
+ 'comma-dangle': ['error', 'never'],
5
+ 'import/no-unresolved': 'off',
6
+ 'import/no-extraneous-dependencies': 'off',
7
+ 'import/extensions': 'off',
8
+ semi: ['error', 'never'],
9
+ },
10
+ 'env': {
11
+ 'browser': true,
12
+ 'node': true,
13
+ },
14
+ };
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ /.bundle
2
+ /pkg
3
+ /test/test_app/log
4
+ node_modules
5
+ .byebug_history
6
+ /test/test_app/tmp
data/.rubocop.yml ADDED
@@ -0,0 +1,124 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.2
3
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4
+ # to ignore them, so only the ones explicitly set in this file are enabled.
5
+ DisabledByDefault: true
6
+ Exclude:
7
+ - 'lib/install/templates/**'
8
+ - 'vendor/**/*'
9
+ - 'node_modules/**/*'
10
+
11
+ # Prefer &&/|| over and/or.
12
+ Style/AndOr:
13
+ Enabled: true
14
+
15
+ # Do not use braces for hash literals when they are the last argument of a
16
+ # method call.
17
+ Style/BracesAroundHashParameters:
18
+ Enabled: true
19
+
20
+ # Align `when` with `case`.
21
+ Layout/CaseIndentation:
22
+ Enabled: true
23
+
24
+ # Align comments with method definitions.
25
+ Layout/CommentIndentation:
26
+ Enabled: true
27
+
28
+ # No extra empty lines.
29
+ Layout/EmptyLines:
30
+ Enabled: true
31
+
32
+ # In a regular class definition, no empty lines around the body.
33
+ Layout/EmptyLinesAroundClassBody:
34
+ Enabled: true
35
+
36
+ # In a regular method definition, no empty lines around the body.
37
+ Layout/EmptyLinesAroundMethodBody:
38
+ Enabled: true
39
+
40
+ # In a regular module definition, no empty lines around the body.
41
+ Layout/EmptyLinesAroundModuleBody:
42
+ Enabled: true
43
+
44
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
45
+ Style/HashSyntax:
46
+ Enabled: true
47
+
48
+ # Method definitions after `private` or `protected` isolated calls need one
49
+ # extra level of indentation.
50
+ Layout/IndentationConsistency:
51
+ Enabled: true
52
+ EnforcedStyle: rails
53
+
54
+ # Two spaces, no tabs (for indentation).
55
+ Layout/IndentationWidth:
56
+ Enabled: true
57
+
58
+ Layout/SpaceAfterColon:
59
+ Enabled: true
60
+
61
+ Layout/SpaceAfterComma:
62
+ Enabled: true
63
+
64
+ Layout/SpaceAroundEqualsInParameterDefault:
65
+ Enabled: true
66
+
67
+ Layout/SpaceAroundKeyword:
68
+ Enabled: true
69
+
70
+ Layout/SpaceAroundOperators:
71
+ Enabled: true
72
+
73
+ Layout/SpaceBeforeFirstArg:
74
+ Enabled: true
75
+
76
+ # Defining a method with parameters needs parentheses.
77
+ Style/MethodDefParentheses:
78
+ Enabled: true
79
+
80
+ # Use `foo {}` not `foo{}`.
81
+ Layout/SpaceBeforeBlockBraces:
82
+ Enabled: true
83
+
84
+ # Use `foo { bar }` not `foo {bar}`.
85
+ Layout/SpaceInsideBlockBraces:
86
+ Enabled: true
87
+
88
+ # Use `{ a: 1 }` not `{a:1}`.
89
+ Layout/SpaceInsideHashLiteralBraces:
90
+ Enabled: true
91
+
92
+ Layout/SpaceInsideParens:
93
+ Enabled: true
94
+
95
+ # Check quotes usage according to lint rule below.
96
+ Style/StringLiterals:
97
+ Enabled: true
98
+ EnforcedStyle: double_quotes
99
+
100
+ # Detect hard tabs, no hard tabs.
101
+ Layout/Tab:
102
+ Enabled: true
103
+
104
+ # Blank lines should not have any spaces.
105
+ Layout/TrailingBlankLines:
106
+ Enabled: true
107
+
108
+ # No trailing whitespace.
109
+ Layout/TrailingWhitespace:
110
+ Enabled: true
111
+
112
+ # Use quotes for string literals when they are enough.
113
+ Style/UnneededPercentQ:
114
+ Enabled: true
115
+
116
+ # Align `end` with the matching keyword or starting expression except for
117
+ # assignments, where it should be aligned with the LHS.
118
+ Lint/EndAlignment:
119
+ Enabled: true
120
+ EnforcedStyleAlignWith: variable
121
+
122
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
123
+ Lint/RequireParentheses:
124
+ Enabled: true
data/.travis.yml ADDED
@@ -0,0 +1,32 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.8
5
+ - 2.3.5
6
+ - 2.4.2
7
+ - ruby-head
8
+ gemfile:
9
+ - gemfiles/Gemfile-rails.4.2.x
10
+ - gemfiles/Gemfile-rails.5.0.x
11
+ - gemfiles/Gemfile-rails.5.1.x
12
+ - gemfiles/Gemfile-rails-edge
13
+ cache:
14
+ bundler: true
15
+ directories:
16
+ - node_modules
17
+ yarn: true
18
+
19
+ install:
20
+ - bundle install
21
+ - nvm install node
22
+ - node -v
23
+ - npm i -g yarn
24
+ - yarn
25
+ script:
26
+ - yarn lint
27
+ - yarn test
28
+ - bundle exec rubocop
29
+ - bundle exec rake test
30
+ matrix:
31
+ allow_failures:
32
+ - gemfile: gemfiles/Gemfile-rails-edge
data/CHANGELOG.md ADDED
@@ -0,0 +1,523 @@
1
+ **Please note that Webpacker 3.1.0 and 3.1.1 has some serious bugs so please consider using either 3.0.2 or 3.2.0**
2
+
3
+ ## [3.2.0] - 2017-12-16
4
+
5
+ ### To upgrade:
6
+
7
+ ```bash
8
+ bundle update webpacker
9
+ yarn upgrade @rails/webpacker
10
+ ```
11
+
12
+ ### Breaking changes
13
+
14
+ If you are using react, vue, angular, elm, erb or coffeescript inside your
15
+ `packs/` please re-run the integration installers as described in the README.
16
+
17
+ ```bash
18
+ bundle exec rails webpacker:install:react
19
+ bundle exec rails webpacker:install:vue
20
+ bundle exec rails webpacker:install:angular
21
+ bundle exec rails webpacker:install:elm
22
+ bundle exec rails webpacker:install:erb
23
+ bundle exec rails webpacker:install:coffee
24
+ ```
25
+
26
+ Or simply copy required loaders used in your app from
27
+ https://github.com/rails/webpacker/tree/master/lib/install/loaders
28
+ into your `config/webpack/loaders/`
29
+ directory and add it to webpack build from `config/webpack/environment.js`
30
+
31
+ ```js
32
+ const erb = require('./loaders/erb')
33
+ const elm = require('./loaders/elm')
34
+ const typescript = require('./loaders/typescript')
35
+ const vue = require('./loaders/vue')
36
+ const coffee = require('./loaders/coffee')
37
+
38
+ environment.loaders.append('coffee', coffee)
39
+ environment.loaders.append('vue', vue)
40
+ environment.loaders.append('typescript', typescript)
41
+ environment.loaders.append('elm', elm)
42
+ environment.loaders.append('erb', erb)
43
+ ```
44
+
45
+ In `.postcssrc.yml` you need to change the plugin name from `postcss-smart-import` to `postcss-import`:
46
+
47
+ ```yml
48
+ plugins:
49
+ postcss-import: {}
50
+ postcss-cssnext: {}
51
+ ```
52
+
53
+ ### Added (npm module)
54
+
55
+ - Upgrade gems and webpack dependencies
56
+
57
+ - `postcss-import` in place of `postcss-smart-import`
58
+
59
+
60
+ ### Removed (npm module)
61
+
62
+ - `postcss-smart-import`, `coffee-loader`, `url-loader`, `rails-erb-loader` as dependencies
63
+
64
+ - `publicPath` from file loader [#1107](https://github.com/rails/webpacker/pull/1107)
65
+
66
+
67
+ ### Fixed (npm module)
68
+
69
+ - Return native array type for `ConfigList` [#1098](https://github.com/rails/webpacker/pull/1098)
70
+
71
+
72
+ ### Added (Gem)
73
+
74
+ - New `asset_pack_url` helper [#1102](https://github.com/rails/webpacker/pull/1102)
75
+
76
+ - New installers for coffee and erb
77
+
78
+ ```bash
79
+ bundle exec rails webpacker:install:erb
80
+ bundle exec rails webpacker:install:coffee
81
+ ```
82
+
83
+ - Resolved paths from webpacker.yml to compiler watched list
84
+
85
+
86
+ ## [3.1.1] - 2017-12-11
87
+
88
+ ### Fixed
89
+
90
+ - Include default webpacker.yml config inside npm package
91
+
92
+
93
+ ## [3.1.0] - 2017-12-11
94
+
95
+
96
+ ### Added (npm module)
97
+
98
+ - Expose base config from environment
99
+
100
+ ```js
101
+ environment.config.set('resolve.extensions', ['.foo', '.bar'])
102
+ environment.config.set('output.filename', '[name].js')
103
+ environment.config.delete('output.chunkFilename')
104
+ environment.config.get('resolve')
105
+ environment.config.merge({ output: {
106
+ filename: '[name].js'
107
+ }
108
+ })
109
+ ```
110
+
111
+ - Expose new API's for loaders and plugins to insert at position
112
+
113
+ ```js
114
+ const jsonLoader = {
115
+ test: /\.json$/,
116
+ exclude: /node_modules/,
117
+ loader: 'json-loader'
118
+ }
119
+
120
+ environment.loaders.append('json', jsonLoader)
121
+ environment.loaders.prepend('json', jsonLoader)
122
+ environment.loaders.insert('json', jsonLoader, { after: 'style' } )
123
+ environment.loaders.insert('json', jsonLoader, { before: 'babel' } )
124
+
125
+ // Update a plugin
126
+ const manifestPlugin = environment.plugins.get('Manifest')
127
+ manifestPlugin.opts.writeToFileEmit = false
128
+
129
+ // Update coffee loader to use coffeescript 2
130
+ const babelLoader = environment.loaders.get('babel')
131
+ environment.loaders.insert('coffee', {
132
+ test: /\.coffee(\.erb)?$/,
133
+ use: babelLoader.use.concat(['coffee-loader'])
134
+ }, { before: 'json' })
135
+ ```
136
+
137
+ - Expose `resolve.modules` paths like loaders and plugins
138
+
139
+ ```js
140
+ environment.resolvedModules.append('vendor', 'vendor')
141
+ ```
142
+
143
+ - Enable sourcemaps in `style` and `css` loader
144
+
145
+ - Separate `css` and `sass` loader for easier configuration. `style` loader is now
146
+ `css` loader, which resolves `.css` files and `sass` loader resolves `.scss` and `.sass`
147
+ files.
148
+
149
+ ```js
150
+ // Enable css modules with sass loader
151
+ const sassLoader = environment.loaders.get('sass')
152
+ const cssLoader = sassLoader.use.find(loader => loader.loader === 'css-loader')
153
+
154
+ cssLoader.options = Object.assign(cssLoader.options, {
155
+ modules: true,
156
+ localIdentName: '[path][name]__[local]--[hash:base64:5]'
157
+ })
158
+ ```
159
+
160
+ - Expose rest of configurable dev server options from webpacker.yml
161
+
162
+ ```yml
163
+ quiet: false
164
+ headers:
165
+ 'Access-Control-Allow-Origin': '*'
166
+ watch_options:
167
+ ignored: /node_modules/
168
+ ```
169
+
170
+ - `pretty` option to disable/enable color and progress output when running dev server
171
+
172
+ ```yml
173
+ dev_server:
174
+ pretty: false
175
+ ```
176
+
177
+ - Enforce deterministic loader order in desc order, starts processing from top to bottom
178
+
179
+ - Enforce the entire path of all required modules match the exact case of the actual path on disk using [case sensitive paths plugin](https://github.com/Urthen/case-sensitive-paths-webpack-plugin).
180
+
181
+ - Add url loader to process and embed smaller static files
182
+
183
+
184
+ ### Removed
185
+
186
+ - resolve url loader [#1042](https://github.com/rails/webpacker/issues/1042)
187
+
188
+ ### Added (Gem)
189
+
190
+ - Allow skipping webpacker compile using an env variable
191
+
192
+ ```bash
193
+ WEBPACKER_PRECOMPILE=no|false|n|f
194
+ WEBPACKER_PRECOMPILE=false bundle exec rails assets:precompile
195
+ ```
196
+
197
+ - Use `WEBPACKER_ASSET_HOST` instead of `ASSET_HOST` for CDN
198
+
199
+ - Alias `webpacker:compile` task to `assets:precompile` if is not defined so it works
200
+ without sprockets
201
+
202
+
203
+ ## [3.0.2] - 2017-10-04
204
+
205
+ ### Added
206
+
207
+ - Allow dev server connect timeout (in seconds) to be configurable, default: 0.01
208
+
209
+ ```rb
210
+ # Change to 1s
211
+ Webpacker.dev_server.connect_timeout = 1
212
+ ```
213
+
214
+ - Restrict the source maps generated in production [#770](https://github.com/rails/webpacker/pull/770)
215
+
216
+ - Binstubs [#833](https://github.com/rails/webpacker/pull/833)
217
+
218
+ - Allow dev server settings to be overriden by env variables [#843](https://github.com/rails/webpacker/pull/843)
219
+
220
+ - A new `lookup` method to manifest to perform lookup without raise and return `nil`
221
+
222
+ ```rb
223
+ Webpacker.manifest.lookup('foo.js')
224
+ # => nil
225
+ Webpacker.manifest.lookup!('foo.js')
226
+ # => raises Webpacker::Manifest::MissingEntryError
227
+ ```
228
+
229
+ - Catch all exceptions in `DevServer.running?` and return false [#878](https://github.com/rails/webpacker/pull/878)
230
+
231
+ ### Removed
232
+
233
+ - Inline CLI args for dev server binstub, use env variables instead
234
+
235
+ - Coffeescript as core dependency. You have to manually add coffeescript now, if you are using
236
+ it in your app.
237
+
238
+ ```bash
239
+ yarn add coffeescript@1.12.7
240
+
241
+ # OR coffeescript 2.0
242
+ yarn add coffeescript
243
+ ```
244
+
245
+ ## [3.0.1] - 2017-09-01
246
+
247
+ ### Fixed
248
+
249
+ - Missing `node_modules/.bin/*` files by bumping minimum Yarn version to 0.25.2 [#727](https://github.com/rails/webpacker/pull/727)
250
+
251
+ - `webpacker:compile` task so that fails properly when webpack compilation fails [#728](https://github.com/rails/webpacker/pull/728)
252
+
253
+ - Rack dev server proxy middleware when served under another proxy (example: pow), which uses `HTTP_X_FORWARDED_HOST` header resulting in `404` for webpacker assets
254
+
255
+ - Make sure tagged logger works with rails < 5 [#716](https://github.com/rails/webpacker/pull/716)
256
+
257
+ ### Added
258
+
259
+ - Allow webpack dev server listen host/ip to be configurable using additional `--listen-host` option
260
+
261
+ ```bash
262
+ ./bin/webpack-dev-server --listen-host 0.0.0.0 --host localhost
263
+ ```
264
+
265
+ ### Removed
266
+
267
+ - `watchContentBase` from devServer config so it doesn't unncessarily trigger
268
+ live reload when manifest changes. If you have applied this workaround from [#724](https://github.com/rails/webpacker/issues/724), please revert the change from `config/webpack/development.js` since this is now fixed.
269
+
270
+
271
+ ## [3.0.0] - 2017-08-30
272
+
273
+ ### Added
274
+
275
+ - `resolved_paths` option to allow adding additional paths webpack should lookup when resolving modules
276
+
277
+ ```yml
278
+ # config/webpacker.yml
279
+ # Additional paths webpack should lookup modules
280
+ resolved_paths: [] # empty by default
281
+ ```
282
+
283
+ - `Webpacker::Compiler.fresh?` and `Webpacker::Compiler.stale?` answer the question of whether compilation is needed.
284
+ The old `Webpacker::Compiler.compile?` predicate is deprecated.
285
+
286
+ - Dev server config class that exposes config options through singleton.
287
+
288
+ ```rb
289
+ Webpacker.dev_server.running?
290
+ ```
291
+
292
+ - Rack middleware proxies webpacker requests to dev server so we can always serve from same-origin and the lookup works out of the box - no more paths prefixing
293
+
294
+ - `env` attribute on `Webpacker::Compiler` allows setting custom environment variables that the compilation is being run with
295
+
296
+ ```rb
297
+ Webpacker::Compiler.env['FRONTEND_API_KEY'] = 'your_secret_key'
298
+ ```
299
+
300
+ ### Breaking changes
301
+
302
+ **Note:** requires running `jets webpacker:install`
303
+
304
+ `config/webpack/**/*.js`:
305
+
306
+ - The majority of this config moved to the [@rails/webpacker npm package](https://www.npmjs.com/package/@rails/webpacker). `webpacker:install` only creates `config/webpack/{environment,development,test,production}.js` now so if you're upgrading from a previous version you can remove all other files.
307
+
308
+ `webpacker.yml`:
309
+
310
+ - Move dev-server config options under defaults so it's transparently available in all environments
311
+
312
+ - Add new `HMR` option for hot-module-replacement
313
+
314
+ - Add HTTPS
315
+
316
+ ### Removed
317
+
318
+ - Host info from manifest.json, now looks like this:
319
+
320
+ ```json
321
+ {
322
+ "hello_react.js": "/packs/hello_react.js"
323
+ }
324
+ ```
325
+
326
+ ### Fixed
327
+
328
+ - Update `webpack-dev-server.tt` to respect RAILS_ENV and NODE_ENV values [#502](https://github.com/rails/webpacker/issues/502)
329
+ - Use `0.0.0.0` as default listen address for `webpack-dev-server`
330
+ - Serve assets using `localhost` from dev server - [#424](https://github.com/rails/webpacker/issues/424)
331
+
332
+ ```yml
333
+ dev_server:
334
+ host: localhost
335
+ ```
336
+
337
+ - On Windows, `ruby bin/webpacker` and `ruby bin/webpacker-dev-server` will now bypass yarn, and execute via `node_modules/.bin` directly - [#584](https://github.com/rails/webpacker/pull/584)
338
+
339
+ ### Breaking changes
340
+
341
+ - Add `compile` and `cache_path` options to `config/webpacker.yml` for configuring lazy compilation of packs when a file under tracked paths is changed [#503](https://github.com/rails/webpacker/pull/503). To enable expected behavior, update `config/webpacker.yml`:
342
+
343
+ ```yaml
344
+ default: &default
345
+ cache_path: tmp/cache/webpacker
346
+ test:
347
+ compile: true
348
+
349
+ development:
350
+ compile: true
351
+
352
+ production:
353
+ compile: false
354
+ ```
355
+
356
+ - Make test compilation cacheable and configurable so that the lazy compilation
357
+ only triggers if files are changed under tracked paths.
358
+ Following paths are watched by default -
359
+
360
+ ```rb
361
+ ["app/javascript/**/*", "yarn.lock", "package.json", "config/webpack/**/*"]
362
+ ```
363
+
364
+ To add more paths:
365
+
366
+ ```rb
367
+ # config/initializers/webpacker.rb or config/application.rb
368
+ Webpacker::Compiler.watched_paths << 'bower_components'
369
+ ```
370
+
371
+ ## [2.0] - 2017-05-24
372
+
373
+ ### Fixed
374
+ - Update `.babelrc` to fix compilation issues - [#306](https://github.com/rails/webpacker/issues/306)
375
+
376
+ - Duplicated asset hosts - [#320](https://github.com/rails/webpacker/issues/320), [#397](https://github.com/rails/webpacker/pull/397)
377
+
378
+ - Missing asset host when defined as a `Proc` or on `ActionController::Base.asset_host` directly - [#397](https://github.com/rails/webpacker/pull/397)
379
+
380
+ - Incorrect asset host when running `webpacker:compile` or `bin/webpack` in development mode - [#397](https://github.com/rails/webpacker/pull/397)
381
+
382
+ - Update `webpacker:compile` task to use `stdout` and `stderr` for better logging - [#395](https://github.com/rails/webpacker/issues/395)
383
+
384
+ - ARGV support for `webpack-dev-server` - [#286](https://github.com/rails/webpacker/issues/286)
385
+
386
+
387
+ ### Added
388
+ - [Elm](http://elm-lang.org) support. You can now add Elm support via the following methods:
389
+ - New app: `rails new <app> --webpack=elm`
390
+ - Within an existing app: `rails webpacker:install:elm`
391
+
392
+ - Support for custom `public_output_path` paths independent of `source_entry_path` in `config/webpacker.yml`. `output` is also now relative to `public/`. - [#397](https://github.com/rails/webpacker/pull/397)
393
+
394
+ Before (compile to `public/packs`):
395
+ ```yaml
396
+ source_entry_path: packs
397
+ public_output_path: packs
398
+ ```
399
+ After (compile to `public/sweet/js`):
400
+ ```yaml
401
+ source_entry_path: packs
402
+ public_output_path: sweet/js
403
+ ```
404
+
405
+ - `https` option to use `https` mode, particularly on platforms like - https://community.c9.io/t/running-a-rails-app/1615 or locally - [#176](https://github.com/rails/webpacker/issues/176)
406
+
407
+ - [Babel] Dynamic import() and Class Fields and Static Properties babel plugin to `.babelrc`
408
+
409
+ ```json
410
+ {
411
+ "presets": [
412
+ ["env", {
413
+ "modules": false,
414
+ "targets": {
415
+ "browsers": "> 1%",
416
+ "uglify": true
417
+ },
418
+ "useBuiltIns": true
419
+ }]
420
+ ],
421
+
422
+ "plugins": [
423
+ "syntax-dynamic-import",
424
+ "transform-class-properties", { "spec": true }
425
+ ]
426
+ }
427
+ ```
428
+
429
+ - Source-map support for production bundle
430
+
431
+
432
+ #### Breaking Change
433
+
434
+ - Consolidate and flatten `paths.yml` and `development.server.yml` config into one file - `config/webpacker.yml` - [#403](https://github.com/rails/webpacker/pull/403). This is a breaking change and requires you to re-install webpacker and cleanup old configuration files.
435
+
436
+ ```bash
437
+ bundle update webpacker
438
+ jets webpacker:install
439
+
440
+ # Remove old/unused configuration files
441
+ rm config/webpack/paths.yml
442
+ rm config/webpack/development.server.yml
443
+ rm config/webpack/development.server.js
444
+ ```
445
+
446
+ __Warning__: For now you also have to add a pattern in `.gitignore` by hand.
447
+ ```diff
448
+ /public/packs
449
+ +/public/packs-test
450
+ /node_modules
451
+ ```
452
+
453
+ ## [1.2] - 2017-04-27
454
+ Some of the changes made requires you to run below commands to install new changes.
455
+
456
+ ```
457
+ bundle update webpacker
458
+ jets webpacker:install
459
+ ```
460
+
461
+
462
+ ### Fixed
463
+ - Support Spring - [#205](https://github.com/rails/webpacker/issues/205)
464
+
465
+ ```ruby
466
+ Spring.after_fork { Webpacker.bootstrap } if defined?(Spring)
467
+ ```
468
+ - Check node version and yarn before installing webpacker - [#217](https://github.com/rails/webpacker/issues/217)
469
+
470
+ - Include webpacker helper to views - [#172](https://github.com/rails/webpacker/issues/172)
471
+
472
+ - Webpacker installer on windows - [#245](https://github.com/rails/webpacker/issues/245)
473
+
474
+ - Yarn duplication - [#278](https://github.com/rails/webpacker/issues/278)
475
+
476
+ - Add back Spring for `rails-erb-loader` - [#216](https://github.com/rails/webpacker/issues/216)
477
+
478
+ - Move babel presets and plugins to .babelrc - [#202](https://github.com/rails/webpacker/issues/202)
479
+
480
+
481
+ ### Added
482
+ - A changelog - [#211](https://github.com/rails/webpacker/issues/211)
483
+ - Minimize CSS assets - [#218](https://github.com/rails/webpacker/issues/218)
484
+ - Pack namespacing support - [#201](https://github.com/rails/webpacker/pull/201)
485
+
486
+ For example:
487
+ ```
488
+ app/javascript/packs/admin/hello_vue.js
489
+ app/javascript/packs/admin/hello.vue
490
+ app/javascript/packs/hello_vue.js
491
+ app/javascript/packs/hello.vue
492
+ ```
493
+ - Add tree-shaking support - [#250](https://github.com/rails/webpacker/pull/250)
494
+ - Add initial test case by @kimquy [#259](https://github.com/rails/webpacker/pull/259)
495
+ - Compile assets before test:controllers and test:system
496
+
497
+
498
+ ### Removed
499
+ - Webpack watcher - [#295](https://github.com/rails/webpacker/pull/295)
500
+
501
+
502
+ ## [1.1] - 2017-03-24
503
+
504
+ This release requires you to run below commands to install new features.
505
+
506
+ ```
507
+ bundle update webpacker
508
+ jets webpacker:install
509
+
510
+ # if installed react, vue or angular
511
+ jets webpacker:install:[react, angular, vue]
512
+ ```
513
+
514
+ ### Added (breaking changes)
515
+ - Static assets support - [#153](https://github.com/rails/webpacker/pull/153)
516
+ - Advanced webpack configuration - [#153](https://github.com/rails/webpacker/pull/153)
517
+
518
+
519
+ ### Removed
520
+
521
+ ```rb
522
+ config.x.webpacker[:digesting] = true
523
+ ```