-
Notifications
You must be signed in to change notification settings - Fork 133
Remove sass-rails gem and use cssbundling and dartsass instead #807
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
web: ./bin/rails server -p 3000 -b 0.0.0.0 | ||
js: yarn build --watch | ||
js: yarn build:js --watch | ||
css: yarn build:css --watch |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
//= link_tree ../images | ||
//= link_directory ../stylesheets .css | ||
//= link_tree ../builds |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
if ! gem list foreman -i --silent; then | ||
if gem list --no-installed --exact --silent foreman; then | ||
echo "Installing foreman..." | ||
gem install foreman | ||
fi | ||
|
||
exec foreman start -f Procfile.dev "$@" | ||
# Default to port 3000 if not specified | ||
export PORT="${PORT:-3000}" | ||
|
||
exec foreman start -f Procfile.dev --env /dev/null "$@" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"name": "rails_api_base", | ||
"private": "true", | ||
"engines" : { | ||
"node" : "20.10.0", | ||
"yarn" : "1.22" | ||
"engines": { | ||
"node": "20.10.0", | ||
"yarn": "1.22" | ||
}, | ||
"dependencies": { | ||
"@activeadmin/activeadmin": "3.2.3", | ||
|
@@ -12,9 +12,12 @@ | |
"esbuild": "0.23.0", | ||
"jquery": "3.7.1", | ||
"jquery-ui": "1.14.0", | ||
"jquery-ujs": "1.2.3" | ||
"jquery-ujs": "1.2.3", | ||
"sass": "^1.77.8" | ||
}, | ||
"scripts": { | ||
"build": "node esbuild.config.mjs" | ||
"build": "yarn build:js && yarn build:css", | ||
"build:js": "node esbuild.config.mjs", | ||
"build:css": "sass ./app/assets/stylesheets:./app/assets/builds --no-source-map --load-path=node_modules" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was added by the cssbundling gem. I mean, the default behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I'm just saying that would be nice to have something like "scripts": {
"build": "yarn build:js && yarn build:css",
"build:js": "node esbuild.config.mjs",
"build:css": "sass ./app/assets/stylesheets:./app/assets/builds --no-source-map --load-path=node_modules"
} That way Anyway, if you want to keep it this way, we might need to add the |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this changing from
sprockets
tosprokets-rails
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we keep the
sprockets
gem and remove thesass-rails
, we get this error'require': cannot load such file -- sprockets/railtie
. Replacing it with thesprockets-rails
one solves it. I'm not really sure why this happensThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to understand why and what is the impact of this change. I assume we're good, but let's validate it doesn't have any negative impact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just in case,
sprockets-rails
was already being installed as a dependency onsass-rails
. https://github.com/rootstrap/rails_api_base/pull/807/files#diff-89cade48462044ee1b672dc5f4c3ec250fbd29effcd8932096a23c1283c6731fL571-L573Basically our previous setup wasn't so good, that's the whole issue here.
sprockets-rails
is required for our app that we are using the traditional asset pipeline.