鍍金池/ 問(wèn)答/數(shù)據(jù)庫(kù)  HTML/ next.js 的babelrc 怎么配置,less怎么配置!

next.js 的babelrc 怎么配置,less怎么配置!

.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": []
}

本人剛開始學(xué)習(xí)next

回答
編輯回答
撿肥皂

試試@zeit/next-less

2017年5月28日 15:50