Created
March 29, 2020 20:20
-
-
Save annacoding2020/528b4f35b8efd53c9937e419e6af1480 to your computer and use it in GitHub Desktop.
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 path = require('path'); | |
| const withLess = require('@zeit/next-less'); | |
| const withPlugins = require('next-compose-plugins'); | |
| const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
| const CleanCss = require('clean-css'); | |
| const nextConfig = { | |
| webpack(config) { | |
| config.module.rules.push({ | |
| test: /\.(png|svg|eot|otf|ttf|woff|woff2)$/, | |
| use: { | |
| loader: 'url-loader', | |
| options: { | |
| limit: 8192, | |
| publicPath: '/_next/static/', | |
| outputPath: 'static/', | |
| name: '[name].[ext]', | |
| }, | |
| }, | |
| }); | |
| config.resolve.alias['../../theme.config$'] = path.join(config.context, '/semantic-ui/theme.config'); | |
| config.plugins.push( | |
| new OptimizeCssAssetsPlugin({ | |
| assetNameRegExp: /\.css$/g, | |
| cssProcessor: CleanCss, | |
| cssProcessorOptions: { | |
| sourceMap: true, | |
| }, | |
| canPrint: true, | |
| }) | |
| ); | |
| return config; | |
| }, | |
| }; | |
| const plugins = [withLess]; | |
| module.exports = withPlugins(plugins, nextConfig); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment