Skip to content

Instantly share code, notes, and snippets.

@sandys
Created February 17, 2020 14:44
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 sandys/4462f11342aa08d7bc441e9b84b4516c to your computer and use it in GitHub Desktop.
Save sandys/4462f11342aa08d7bc441e9b84b4516c to your computer and use it in GitHub Desktop.
next.config.js for superprops
const withPlugins = require('next-compose-plugins');
const withTM = require('next-transpile-modules')(['reusecore', 'common']);
const withOptimizedImages = require('next-optimized-images');
const withFonts = require('next-fonts');
const withCSS = require('@zeit/next-css');
const path = require("path");
module.exports = withPlugins(
[
[withTM],
[
withOptimizedImages,
{
mozjpeg: {
quality: 90,
},
webp: {
preset: 'default',
quality: 90,
},
},
],
withFonts,
withCSS,
],
{
distDir: "../../dist/functions/next",
webpack(config) {
config.resolve.alias = {
...config.resolve.alias,
'common': path.join(__dirname, 'common'),
}
return config;
}
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment