-
-
Notifications
You must be signed in to change notification settings - Fork 512
Working with Frontend Assets
Shen Yang edited this page Oct 19, 2022
·
6 revisions
In modern js development, all of the javascript is loaded on all of the pages. This is so the client can use a cached version every page load after the first one. The same is done with css.
To compile javascript once, run yarn build
If you are editing javascript run yarn build:dev. This will compile your javascript every time you edit a js file.
Similarly
To compile css once, run yarn build:css
If you are editing javascript run yarn build:css:dev. This will compile your css every time you edit a js file.
Be careful not to run the rake command precompile assets. If you have assets in the public folder, rails will look for assets here instead of app/assets/builds/ where our assets are expected to be built.