Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Commit

Permalink
feat: add postcss loader
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcodes committed Sep 19, 2020
1 parent aa06901 commit b2aa349
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 147 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.9.0
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
gem 'webpacker', '~> 5.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
Expand Down
10 changes: 6 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ GEM
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
semantic_range (2.3.0)
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
Expand All @@ -151,10 +152,11 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webpacker (4.3.0)
activesupport (>= 4.2)
webpacker (5.2.1)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -176,7 +178,7 @@ DEPENDENCIES
turbolinks (~> 5)
tzinfo-data
web-console (>= 3.3.0)
webpacker (~> 4.0)
webpacker (~> 5.2)

RUBY VERSION
ruby 2.7.1p83
Expand Down
12 changes: 10 additions & 2 deletions config/webpack/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
const { environment } = require('@rails/webpacker')
const { environment } = require("@rails/webpacker");

module.exports = environment
["css", "moduleCss"].forEach((loaderName) => {
const loader = environment.loaders.get(loaderName);

loader.test = /\.(p?css)$/i;

environment.loaders.insert(loaderName, loader);
});

module.exports = environment;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"@rails/actioncable": "^6.0.0",
"@rails/activestorage": "^6.0.0",
"@rails/ujs": "^6.0.0",
"@rails/webpacker": "4.3.0",
"@rails/webpacker": "^5.2.0",
"turbolinks": "^5.2.0"
},
"version": "0.1.0",
Expand Down
Loading

0 comments on commit b2aa349

Please sign in to comment.