Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const withSass = require('@zeit/next-sass');
- const withCSS = require('@zeit/next-css');
- const withFonts = require('next-fonts');
- const withPlugins = require('next-compose-plugins');
- const optimizedImages = require('next-optimized-images');
- const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
- const webpack = require('webpack');
- const DotEnv = require('dotenv');
- const path = require('path');
- const withBabelMinify = require('next-babel-minify')();
- DotEnv.config();
- module.exports = withPlugins(
- [
- [
- optimizedImages,
- {
- inlineImageLimit: 8192,
- imagesFolder: 'images',
- imagesName: '[name]-[hash].[ext]',
- handleImages: ['jpeg', 'jpg', 'png', 'svg', 'webp', 'gif', 'ico'],
- optimizeImages: true,
- optimizeImagesInDev: false,
- mozjpeg: {
- quality: 80
- },
- optipng: {
- optimizationLevel: 3
- },
- pngquant: false,
- gifsicle: {
- interlaced: true,
- optimizationLevel: 3
- },
- webp: {
- preset: 'default',
- quality: 75
- }
- }
- ],
- [withCSS],
- [withFonts],
- [withSass],
- [withBabelMinify]
- ],
- {
- exportPathMap() {
- return {
- '/': { page: '/' }
- };
- },
- webpack: config => {
- config.plugins.push(new webpack.EnvironmentPlugin(process.env));
- config.resolve.alias = {
- ...config.resolve.alias,
- '@actions': path.resolve('src/store/actions'),
- '@components': path.resolve('src/components'),
- '@containers': path.resolve('src/containers'),
- '@configs': path.resolve('src/configs'),
- '@helpers': path.resolve('src/helpers'),
- '@images': path.resolve('src/assets/images'),
- '@styles': path.resolve('src/assets/styles'),
- '@layout': path.resolve('src/layout'),
- '@reducers': path.resolve('src/store/reducers')
- };
- config.optimization.minimizer = [];
- config.optimization.minimizer.push(new OptimizeCSSAssetsPlugin({}));
- return config;
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement