Skip to content

Commit

Permalink
assets compilation js & tw before precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Nov 15, 2023
1 parent 8aab199 commit 35e93c7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
bundle install --jobs 4 --retry 3
bundle exec rails db:prepare
bin/rails tailwindcss:build
bin/rails javascript:build
bundle exec rake assets:precompile
- name: Build and run tests
env:
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ COPY --chown=docker:docker . /usr/src/app/
RUN NODE_OPTIONS="--max-old-space-size=2048" \
RAILS_ENV=${APP_ENV} \
SECRET_KEY_BASE=`bin/rails secret` \
bundle exec rails assets:precompile --trace \
bundle exec rails tailwindcss:build \
&& bundle exec rails javascript:build \
&& bundle exec rails assets:precompile --trace \
&& rm -rf /usr/src/app/node_modules /usr/src/app/tmp/cache/* /tmp/* \
&& yarn cache clean
4 changes: 2 additions & 2 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Rails.application.config.assets.version = "1.0"

# Rails.application.config.assets.paths << Rails.root.join('node_modules')
Rails.application.config.assets.precompile += %w[campaign.css tailwind.css]
Rails.application.config.assets.precompile += %w[embed.js new_embed.js new_application.js article.js]
# Rails.application.config.assets.precompile += %w[campaign.css tailwind.css]
Rails.application.config.assets.precompile += %w[embed.js new_embed.js]

Rails.application.config.assets.paths << Rails.root.join('app', 'assets', 'fonts')

Expand Down
2 changes: 0 additions & 2 deletions lib/tasks/utils.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ class Hammer < Thor
include Thor::Actions
end

Rake::Task["assets:precompile"].enhance(["tailwindcss:build"])

namespace :packages do
def hammer(*)
Hammer.new.send(*)
Expand Down

0 comments on commit 35e93c7

Please sign in to comment.