Skip to content

Commit

Permalink
Use webpack extract_css: true all of the time
Browse files Browse the repository at this point in the history
Webpacker has a nasty habit of not compiling css files for components and then causing an error in production when they are missing.
rails/webpacker#2342
rails/webpacker#2059 (comment)

Unfortunately using extract_css: true all the time apparently comes with some performance impacts, however the tradeoff is the application actually works correctly in development mode.
  • Loading branch information
Robert Clark committed Aug 18, 2021
1 parent 3a57b7c commit f036f6c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/views/projects/index.html.haml
@@ -1,8 +1,7 @@
- content_for :assets do
= javascript_pack_tag 'projects'
= stylesheet_pack_tag 'projects'

#Projects
%Projects{ |
'v-bind:projects': @projects.to_json, |
}
}
3 changes: 1 addition & 2 deletions app/views/users/index.html.haml
@@ -1,8 +1,7 @@
- content_for :assets do
= javascript_pack_tag 'users'
= stylesheet_pack_tag 'users'

#users
%Users{ |
'v-bind:users': @users.to_json, |
}
}
2 changes: 1 addition & 1 deletion config/webpacker.yml
Expand Up @@ -17,7 +17,7 @@ default: &default
cache_manifest: false

# Extract and emit a css file
extract_css: false
extract_css: true

static_assets_extensions:
- .jpg
Expand Down

0 comments on commit f036f6c

Please sign in to comment.