Skip to content

Commit 8b2fd41

Browse files
authored
Merge pull request #114 from FluentifyJs/feature/fixing-storybook
Updating storybook configuration/setup
2 parents e9813c1 + 76861d2 commit 8b2fd41

File tree

7 files changed

+56
-44
lines changed

7 files changed

+56
-44
lines changed

.storybook/addons.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

.storybook/main.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const path = require('path')
2+
3+
module.exports = {
4+
addons: [
5+
'@storybook/preset-scss',
6+
'@storybook/addon-actions',
7+
'@storybook/addon-links'
8+
],
9+
webpackFinal: async (config, { configType }) => {
10+
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
11+
// You can change the configuration based on that.
12+
// 'PRODUCTION' is used when building the static version of storybook.
13+
14+
// Make whatever fine-grained changes you need
15+
config.module.rules.push({
16+
test: /\.scss$/,
17+
use: ['style-loader', 'css-loader', 'sass-loader'],
18+
include: path.resolve(__dirname, '../'),
19+
},
20+
{
21+
test: /\.(png|svg|jpg|gif)$/,
22+
use: [
23+
'file-loader',
24+
],
25+
include: path.resolve(__dirname, "../")
26+
});
27+
28+
// Return the altered config
29+
return config;
30+
},
31+
};
32+

.storybook/manager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { addons } from '@storybook/addons';
2+
import yourTheme from './theme';
3+
4+
addons.setConfig({
5+
theme: yourTheme,
6+
});

.storybook/config.js renamed to .storybook/preview.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
/* eslint-disable import/no-extraneous-dependencies */
2-
import { configure, addParameters, addDecorator } from '@storybook/vue'
3-
import theme from './theme';
2+
import { configure, addDecorator } from '@storybook/vue'
43

5-
import '../src/scss/fluentify.scss'
4+
import '!style-loader!css-loader!sass-loader!../src/scss/fluentify.scss'
65

76
const req = require.context('../src/stories', true, /.stories.js$/)
87

9-
addParameters({
10-
options: {
11-
theme: theme,
12-
},
13-
});
14-
158
addDecorator(() => ({
169
template: '<div style="padding:20px;"><story/></div>',
1710
}))

.storybook/webpack.config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

package-lock.json

Lines changed: 15 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"style": "dist/fluentify.css",
117117
"unpkg": "dist/fluentify.js",
118118
"dependencies": {
119+
"@storybook/preset-scss": "^1.0.2",
119120
"vue": "^2.6.12"
120121
}
121122
}

0 commit comments

Comments
 (0)