/storybook-less-loader

Primary LanguageJavaScriptMIT LicenseMIT

storybook-less-loader

Add less loader with storybook

  1. Install: npm i storybook-less-loader less-loader less --save-dev
  2. Open .storybook/main.js, add
  const useLessLoader = require('storybook-less-loader')
  module.exports = {
    ...,
    webpackFinal: async (config) => {
      const includeLessConfig = useLessLoader(config, function(lessLoaderRule) {
        // do something
        return lessLoaderRule
      })
      return includeLessConfig
    }
  }