.babel怎么配置
less怎么配置
加了next.config.js 根本不起作用
const withLess = require('@zeit/next-less')
module.exports = withLess({
webpack: (config, { buildId, dev, isServer, defaultLoaders }) => {
// Perform customizations to webpack config
// Important: return the modified config
config.module.rules.push({
test: /\.less$/,
use: [{
loader: "style-loader"
}, {
loader: "css-loader"
}, {
loader: "less-loader", options: {
sourceMap: true
}
}]
})
console.log(config.module.rules, '--')
return config
},
webpackDevMiddleware: config => {
// Perform customizations to webpack dev middleware config
// console.log(config, '@@')
// Important: return the modified config
return config
}
})
.babelrc
{
"presets": [
[]
],
"ignore": []
}
本人刚开始学习next
试试@zeit/next-less