Skip to content

Commit 3583a2e

Browse files
akoushkelalli-flores
authored andcommitted
feat(storybook): configure sass-resource-loader
1 parent ca23def commit 3583a2e

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.storybook/webpack.config.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
const path = require('path');
22

33
// Export a function. Accept the base config as the only param.
4-
module.exports = async ({ config, mode }) => {
5-
4+
module.exports = async ({config, mode}) => {
65
// Make whatever fine-grained changes you need
76
config.module.rules.push({
87
test: /\.scss$/,
9-
use: ['style-loader', 'css-loader', 'sass-loader'],
10-
include: path.resolve(__dirname, '../'),
8+
use: [
9+
'style-loader',
10+
'css-loader',
11+
'sass-loader',
12+
// Load both momentum and project styles globally, to avoid manual import on every SASS module
13+
{
14+
loader: 'sass-resources-loader',
15+
options: {
16+
resources: [
17+
path.resolve(__dirname, '../src/styles/index.scss'),
18+
path.resolve(__dirname, '../momentum-ui.scss'),
19+
],
20+
},
21+
},
22+
],
1123
});
1224

1325
return config;

0 commit comments

Comments
 (0)