webpack使用less

cnpm install less less-loader --save-dev
module.exports = {
  module: {
    rules: [
      {
        test: /\.less$/i,
        use: [
          {
            loader: 'style-loader',
          },
          {
            loader: 'css-loader',
          },
          {
            loader: 'less-loader',
            options: {
              lessOptions: {
                strictMath: true,
              },
            },
          },
        ],
      },
    ],
  },
};

posted @ 2021-07-07 11:25  thomas_blog  阅读(193)  评论(0编辑  收藏  举报