Skip to content

Instantly share code, notes, and snippets.

@kktam
Created October 10, 2019 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kktam/6248422d4204be1dee0d70932ec80886 to your computer and use it in GitHub Desktop.
Save kktam/6248422d4204be1dee0d70932ec80886 to your computer and use it in GitHub Desktop.
Combining CSS image loading and SASS in next.config.js
const withCSS = require("@zeit/next-css");
const cssConfig = withCSS({
cssModules: true,
webpack: config => {
config.module.rules.push({
test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
use: {
loader: "url-loader",
options: {
limit: 100000,
name: "[name].[ext]"
}
}
});
return config;
}
});
const withSass = require('@zeit/next-sass')
const sassConfig = withSass();
module.exports = Object.assign(
cssConfig, { target: "serverless" },
sassConfig, { target: "serverless" }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment