rails new demoRAILS_ENV=production rails assets:precompileThe 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
The test assets such as /public/assets/@rails/webpacker/lib/install/examples/stimulus/ should not be compiled in production mode.
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.Rails version: Rails 6.0.0.beta1
Ruby version: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
@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",
IMO, we should revert https://github.com/rails/webpacker/commit/895d2cfc15eda2edae9e667c642a02523d958f53.
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.
Most helpful comment
Makes sense, perhaps we can use next tag to install the pre version instead (if one)?
yarn add @rails/webpacker@next