Webpacker: Rails 6.0.0.beta1: Webpacker builds test app assets

Created on 22 Jan 2019  Â·  5Comments  Â·  Source: rails/webpacker

Steps to reproduce

  1. Create a new project: rails new demo
  2. In the new project's directory, run RAILS_ENV=production rails assets:precompile

The webpacker will compile all the test assets, for example:

I, [2019-01-22T23:02:04.425519 #15074]  INFO -- : Writing /Users/[username]/Downloads/201901/temp/demo/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css
I, [2019-01-22T23:02:04.426070 #15074]  INFO -- : Writing /Users/[username]/Downloads/201901/temp/demo/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz
I, [2019-01-22T23:02:04.504171 #15074]  INFO -- : Writing /Users/[username]/Downloads/201901/temp/demo/public/assets/@rails/webpacker/lib/install/examples/stimulus/application-54b64229175c4a4533878d37e7d36b83f80058076a2d8e59a2ee525b6cc56d01.js
I, [2019-01-22T23:02:04.504289 #15074]  INFO -- : Writing /Users/[username]/Downloads/201901/temp/demo/public/assets/@rails/webpacker/lib/install/examples/stimulus/application-54b64229175c4a4533878d37e7d36b83f80058076a2d8e59a2ee525b6cc56d01.js.gz
I, [2019-01-22T23:02:04.510394 #15074]  INFO -- : Writing /Users/[username]/Downloads/201901/temp/demo/public/assets/@rails/webpacker/lib/install/javascript/packs/application-e7f8c779987cf143adea07034e42daa9011b8e271378f6d21f489d0c4ba07ded.js
I, [2019-01-22T23:02:04.510628 #15074]  INFO -- : Writing /Users/[username]/Downloads/201901/temp/demo/public/assets/@rails/webpacker/lib/install/javascript/packs/application-e7f8c779987cf143adea07034e42daa9011b8e271378f6d21f489d0c4ba07ded.js.gz
I, [2019-01-22T23:02:04.522095 #15074]  INFO -- : Writing /Users/[username]/Downloads/201901/temp/demo/public/assets/@rails/webpacker/test/test_app/app/javascript/packs/application-e7f8c779987cf143adea07034e42daa9011b8e271378f6d21f489d0c4ba07ded.js
I, [2019-01-22T23:02:04.522267 #15074]  INFO -- : Writing /Users/[username]/Downloads/201901/temp/demo/public/assets/@rails/webpacker/test/test_app/app/javascript/packs/application-e7f8c779987cf143adea07034e42daa9011b8e271378f6d21f489d0c4ba07ded.js.gz
Compiling…
Compiled all packs in /Users/[username]/Downloads/201901/temp/demo/public/packs

Expected behavior

The test assets such as /public/assets/@rails/webpacker/lib/install/examples/stimulus/ should not be compiled in production mode.

Actual behavior


There are some assets compiled including:

  • @rails/webpacker/lib/install/javascript/packs/...
  • @rails/webpacker/test/test_app/app/javascript/packs/...
  • @rails/webpacker/lib/install/examples/stimulus/.... Note: this example project does not have a dependency of stimulus.

System configuration

Rails version: Rails 6.0.0.beta1

Ruby version: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]

Most helpful comment

Makes sense, perhaps we can use next tag to install the pre version instead (if one)? yarn add @rails/webpacker@next

All 5 comments

@javan Do you have any idea, what's going on here?

It has something to do with installing the npm package from github directly. If I point package.json to a published version the problem goes away:

--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
     "@rails/actioncable": "^6.0.0-alpha",
     "@rails/activestorage": "^6.0.0-alpha",
     "@rails/ujs": "^6.0.0-alpha",
-    "@rails/webpacker": "https://github.com/rails/webpacker",
+    "@rails/webpacker": "4.0.0-rc.5",

Makes sense, perhaps we can use next tag to install the pre version instead (if one)? yarn add @rails/webpacker@next

Please try the new release.

Thanks, Javan.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amandapouget picture amandapouget  Â·  3Comments

ilrock picture ilrock  Â·  3Comments

itay-grudev picture itay-grudev  Â·  3Comments

johan-smits picture johan-smits  Â·  3Comments

pioz picture pioz  Â·  3Comments