Skip to content

Instantly share code, notes, and snippets.

@ARozputnii
Last active June 6, 2022 18:55
Show Gist options
  • Save ARozputnii/eeceb1aac6e4653b9776464728f4ebf1 to your computer and use it in GitHub Desktop.
Save ARozputnii/eeceb1aac6e4653b9776464728f4ebf1 to your computer and use it in GitHub Desktop.
RoR-7 | Esbuild setup
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