Skip to content

Commit

Permalink
set up sass config for next. work around for next-sass issue here: ve…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustinyschild committed Oct 14, 2019
1 parent 9539db4 commit ba190b2
Show file tree
Hide file tree
Showing 7 changed files with 1,325 additions and 14 deletions.
3 changes: 3 additions & 0 deletions components/Header/Header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.header {
display: inline-block;
}
9 changes: 9 additions & 0 deletions components/Header/index.js
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;
23 changes: 23 additions & 0 deletions next.config.js
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;
},
});
Loading

0 comments on commit ba190b2

Please sign in to comment.