我正在使用 nextJs,需要添加对 less 和 css 的支持。我想要一个项目同时拥有 next-css 和 next-less 。但它一次接受一个。这是我正在使用的
const withCSS = require('@zeit/next-css')
module.exports = withCSS({
/* config options here */
})
const withLess = require('@zeit/next-less')
module.exports = withLess({
cssModules: false,
lessLoaderOptions: {
javascriptEnabled: true
}
})
我是否正确包含了两个加载程序?我也需要 javascriptEnabled: true 。怎么才能实现这个配置。
如果您能提供一两个提示,我真的很感激。
最佳答案
这应该有效。
const withCSS = require('@zeit/next-css')
const withLess = require('@zeit/next-less')
module.exports = withCSS(withLess())
关于javascript - 在 next.config.js 中同时添加对 next-css 和 next-less 的支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59551075/