Skip to content

Commit

Permalink
Added scoped scss
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnexcodev committed Apr 27, 2022
1 parent da818fe commit ee4cec9
Show file tree
Hide file tree
Showing 14 changed files with 760 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["babel-plugin-react-scoped-css"]
}
16 changes: 16 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const path = require('path');

module.exports = {
stories: [
'../src/**/*.stories.mdx',
Expand All @@ -9,4 +11,18 @@ module.exports = {
'@storybook/addon-interactions',
],
framework: '@storybook/react',
webpackFinal: async (config) => {
config.module.rules.push({
test: /\.scoped\.(sc|c|sa)ss$/,
include: path.resolve(__dirname, '../'),
use: [
'style-loader',
'css-loader',
'scoped-css-loader',
'sass-loader',
],
});

return config;
},
};
3 changes: 3 additions & 0 deletions .virmator/jest/jest-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const virmatorJestConfig: InitialOptionsTsJest = {
},
},
},
moduleNameMapper: {
'.scoped.(sc|c|sa)ss$': '<rootDir>/test/unit/stubs/style.js',
},
};

export default virmatorJestConfig;
Loading

0 comments on commit ee4cec9

Please sign in to comment.