-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set up sass config for next. work around for next-sass issue here: ve…
- Loading branch information
Dustinyschild
committed
Oct 14, 2019
1 parent
9539db4
commit ba190b2
Showing
7 changed files
with
1,325 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.header { | ||
display: inline-block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
|
||
const Header = () => ( | ||
<div className="header"> | ||
<h1>Welcome to Next.js</h1> | ||
</div> | ||
); | ||
|
||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const withSass = require('@zeit/next-sass'); | ||
|
||
function HACK_removeMinimizeOptionFromCssLoaders(config) { | ||
console.warn( | ||
'HACK: Removing `minimize` option from `css-loader` entries in Webpack config', | ||
); | ||
config.module.rules.forEach(rule => { | ||
if (Array.isArray(rule.use)) { | ||
rule.use.forEach(u => { | ||
if (u.loader === 'css-loader' && u.options) { | ||
delete u.options.minimize; | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
module.exports = withSass({ | ||
webpack(config) { | ||
HACK_removeMinimizeOptionFromCssLoaders(config); | ||
return config; | ||
}, | ||
}); |
Oops, something went wrong.