Skip to content

Instantly share code, notes, and snippets.

@MelodicCrypter
Last active February 13, 2020 07:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save MelodicCrypter/03dee48a8a0e113f2afd1c66625c589c to your computer and use it in GitHub Desktop.
Using Bulma, Sass and Image Optimization with NextJS configuration.
const withPlugins = require('next-compose-plugins');
const optimizedImages = require('next-optimized-images');
const withSass = require('@zeit/next-sass');
const withCSS = require('@zeit/next-css');
const nextConfig = {
webpack(config, options) {
config.module.rules.push({
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000,
},
},
});
return config;
},
};
module.exports = withPlugins(
[
// CSS and Sass
[withCSS(withSass())],
// Image optimization
[optimizedImages],
],
// NextJS Configs
nextConfig,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment