<!--
- @Author: starkwang
- @Contact me: https://shudong.wang/about
- @Date: 2019-10-21 18:33:27
- @LastEditors: starkwang
- @LastEditTime: 2019-10-21 18:38:13
- @Description: 【nextjs教程】多插件配置,使用 next-compose-plugins实现 -->
使用 next-compose-plugins 实现多插件配置
const withPlugins = require('next-compose-plugins');
配置规则
module.exports = withPlugins(
[
[
stylus,{插件一}
],
[
css,{插件二}
]
],
nextConfig
);
案例
const nextConfig = {}
module.exports = withPlugins(
[
[
stylus,
{
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName
}
}
],
[
css,
{
cssModules: true,
cssLoaderOptions: {
localIdentName
}
}
]
],
nextConfig
);