Skip to content

Commit

Permalink
[#385] Minify CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
sanG-github committed Jun 21, 2023
1 parent 2d2532f commit dea4c83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .template/variants/web/Procfile.dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
append_to_file 'Procfile.dev' do
<<~PROCFILE
js: yarn build --watch
css: yarn build:css --watch
css: yarn build:css-dev --watch
postcss: yarn build:postcss --watch
PROCFILE
end
7 changes: 7 additions & 0 deletions .template/variants/web/package.json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,17 @@
'--no-source-map',
'--load-path=node_modules'
]
production_bundled_stylesheet_options = [
'--style=compressed'
]

run %(npm set-script build "node app/javascript/build.js")
run %(
npm set-script build:css \
"sass #{source_stylesheet} #{bundled_stylesheet} #{bundled_stylesheet_options.merge(production_bundled_stylesheet_options).join(' ')}"
)
run %(
npm set-script build:css-dev \
"sass #{source_stylesheet} #{bundled_stylesheet} #{bundled_stylesheet_options.join(' ')}"
)
run %(npm set-script postcss "postcss public/assets/*.css --dir public/assets --config ./")
Expand Down

0 comments on commit dea4c83

Please sign in to comment.