Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
imWildCat opened this issue Jan 22, 2019 · 5 comments
Closed

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

imWildCat opened this issue Jan 22, 2019 · 5 comments

Comments

@imWildCat
Copy link

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]

@rafaelfranca rafaelfranca transferred this issue from rails/rails Jan 22, 2019
@gauravtiwari
Copy link
Member

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

@javan
Copy link
Contributor

javan commented Jan 24, 2019

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",

@javan
Copy link
Contributor

javan commented Jan 24, 2019

IMO, we should revert 895d2cf.

@gauravtiwari
Copy link
Member

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

@gauravtiwari
Copy link
Member

Please try the new release.

Thanks, Javan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants