Open qkreltms opened 3 years ago
Here's my main.js
file configuration that works with scss
modules
module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
{
name: "@storybook/preset-scss",
options: {
cssLoaderOptions: {
modules: {
auto: true,
},
},
},
},
],
};
I've tried auto
, but failed.
I have the same problem with storybook@6.3 and webpack@5.
Same problem on storybook@6.4 and webpack@5
Actual have it working on another project the only difference being that is webpack@4
I ran into this issue on a Vue 3 project and this seems to be working for me:
// .storybook/main.js
module.exports = {
stories: [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/preset-scss",
],
framework: "@storybook/vue3",
typescript: {
check: false,
checkOptions: {},
},
webpackFinal: async (config, {
configType
}) => {
config.module.rules.forEach(rule => {
if (rule.test.test(".scss")) {
rule.use.forEach(use => {
if (use.loader.includes("css-loader")) {
use.options = {
modules: true,
};
}
});
}
});
return config;
},
};
Describe the bug
I've tried to use scss so followed instruction to use
@storybook/preset-scss
on documentation and importing scss is workingbut scss module is not working.
Steps to reproduce the behavior
I implemented an example https://github.com/qkreltms/lerna-test1 (webpack branch)
clone my project and type
yarn install
to install all packages and typeyarn storybook
Expected behavior
Should scss module is working (in the example button's background must be set pink)
Screenshots and/or logs
Environment