Created
October 10, 2019 04:03
-
-
Save kktam/6248422d4204be1dee0d70932ec80886 to your computer and use it in GitHub Desktop.
Combining CSS image loading and SASS in next.config.js
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
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