Add less loader with storybook
- Install:
npm i storybook-less-loader less-loader less --save-dev
- 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
}
}