【nextjs教程】多插件配置,使用 next-compose-plugins实现
文章目录
<!--
- @Author: starkwang
- @Contact me: https://shudong.wang/about
- @Date: 2019-10-21 18:33:27
- @LastEditors: starkwang
- @LastEditTime: 2019-10-21 18:36:01
- @Description: 【nextjs教程】多插件配置,使用 next-compose-plugins实现
-->
本文首发:https://shudong.wang/10606.html
使用 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
);

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论