discussionhelp wantedneeds doc
仓库指标
- Star
- (531 star)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
In config/webpacker.yml the extract_css option is currently false unless in production, but this seems to break importing predefined styles.
Should it be true?
In the meantime if you are trying to include styles from an npm module (i.e. bootstrap) do the following:
- create
app/javascript/packs/styles.jsfile and import the style sheets you want. - add
<%= style_sheet_pack_tag 'styles' %>to your layout files. - set
extract_css: trueinconfig/webpacker.yml
Currently trying to find an answer to why this is all necessary here: https://stackoverflow.com/questions/59009216/how-to-get-webpacker-to-load-css-if-extract-css-is-false