Skip to content

Commit

Permalink
clear nextjs less config
Browse files Browse the repository at this point in the history
  • Loading branch information
limichange committed Jan 7, 2020
1 parent 0fc058a commit 3aa4d9b
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions renderer/config/withLess.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,35 @@ module.exports = (nextConfig = {}) => {
]
})

const loaderConfig = {
extensions: ['less'],
cssLoaderOptions,
postcssLoaderOptions,
dev,
isServer,
loaders: [
{
loader: 'less-loader',
options: lessLoaderOptions
}
]
}

config.module.rules.push({
test: /\.less$/,
use: Object.assign(options.defaultLoaders.less, { cssModules: true }),
use: cssLoaderConfig(config, {
cssModules: true,
...loaderConfig
}),
exclude: /node_modules/
})

config.module.rules.push({
test: /\.less$/,
use: Object.assign(options.defaultLoaders.less, { cssModules: false }),
use: cssLoaderConfig(config, {
cssModules: false,
...loaderConfig
}),
include: /node_modules/
})

Expand Down

0 comments on commit 3aa4d9b

Please sign in to comment.