Last active
June 6, 2022 18:55
-
-
Save ARozputnii/eeceb1aac6e4653b9776464728f4ebf1 to your computer and use it in GitHub Desktop.
RoR-7 | Esbuild setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Create new app: | |
rails new your_project -j=esbuild -d=postgresql -T --css [tailwind|bootstrap|bulma|postcss|sass] | |
2. Run: | |
echo 'app' > .ruby-gemset | |
5. Rename main css file in app/assets/stylesheets dir to "application.scss" | |
6. Add to package.json | |
"scripts": { | |
"build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds", | |
when sass/bootstrap - "build:css": "sass ./app/assets/stylesheets/application.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" | |
when tailwind - "build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify" | |
} | |
7. For start a server run: | |
bin/dev | |
if you have an error message: ". .rvm/gems/ruby-3.1.1/bin/foreman: .... " | |
need add gem foreman via terminal in app dir: | |
gem install foreman | |
then try to run server again: "bin/dev" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment