我想在css
和scss
应用程序中使用next.js
。
我的项目中有next.config.js
。
此配置用于scss
// next.config.js
const withSass = require('@zeit/next-sass');
module.exports = withSass({
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: "[local]___[hash:base64:5]",
}
})
我不知道如何将const withCSS = require('@zeit/next-css');
与我的当前配置相结合。
我想为scss
使用自定义配置(来自我的代码片段)。
有人能帮我配置下一个css
和scss
模块吗?
我试过:
// // next.config.js
const withSass = require('@zeit/next-sass');
const withCSS = require('@zeit/next-css');
module.exports = withCSS(withSass({
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: "[local]___[hash:base64:5]",
}
}))
不工作.
发布于 2020-02-12 14:08:52
您可以使用next-compose-plugins
并按以下方式组合多个next.js插件:
// next.config.js
const withPlugins = require('next-compose-plugins');
const withSass = require('@zeit/next-sass');
const withCSS = require('@zeit/next-css');
module.exports = withPlugins(
[
[withSass, { /* plugin config here ... */ }],
[withCSS, { /* plugin config here ... */ }],
],
{
/* global config here ... */
},
);
https://stackoverflow.com/questions/60177847
复制相似问题