Created
August 10, 2019 07:48
-
-
Save Weiyuan-Lane/87599e61c8cf8875c7b703eb8f910644 to your computer and use it in GitHub Desktop.
Development tools for Next configuration
This file contains hidden or 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 withSass = require('@zeit/next-sass'); | |
const path = require('path'); | |
const CompressionPlugin = require('compression-webpack-plugin'); | |
module.exports = withSass({ | |
webpack: function(config) { | |
config.module.rules.push( | |
{ | |
test: /\.(jpe?g|png|gif|svg|ico)$/, | |
use: { | |
loader: 'url-loader', | |
options: { | |
limit: 8192, | |
fallback: 'file-loader', | |
name: '[name].[hash:15].[ext]', | |
}, | |
}, | |
} | |
); | |
config.plugins.push(new CompressionPlugin()); | |
config.resolve.alias['@styles'] = path.join(__dirname, 'styles'); | |
config.resolve.alias['@helpers'] = path.join(__dirname, 'helpers'); | |
config.resolve.alias['@images'] = path.join(__dirname, 'images'); | |
return config; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment