Skip to content

Commit 8424626

Browse files
committed
fix: correct configuration
Signed-off-by: Shubham Shah <shubhamshahrising@gmail.com>
1 parent 40acd29 commit 8424626

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

web-app/.storybook/main.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
1+
const path = require('path')
2+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
3+
14
// import '../src/styles/reset.css'
25

36
module.exports = {
47
core: {
5-
builder: 'webpack5',
8+
builder: 'webpack4',
69
},
710
stories: ['../stories/Temp.stories.tsx', '../stories/Error.stories.tsx'],
811
addons: ['@storybook/addon-actions', '@storybook/addon-knobs', '@storybook/addon-links'],
912
babel: async (options) => ({
1013
...options,
1114
presets: [...options.presets, '@emotion/babel-preset-css-prop', '@babel/preset-react'],
15+
plugins: [
16+
[
17+
'import',
18+
{
19+
libraryName: '@alifd/next',
20+
style: true,
21+
},
22+
],
23+
],
1224
}),
25+
webpackFinal: (config) => {
26+
config.module.rules.push({
27+
test: /\.scss$/,
28+
use: ['style-loader', 'css-loader', 'sass-loader'],
29+
})
30+
config.module.rules.push({
31+
test: /\.(ts|tsx)$/,
32+
loader: require.resolve('babel-loader'),
33+
})
34+
35+
config.plugins.push(new MiniCssExtractPlugin({ filename: '[name].css' }))
36+
config.resolve.extensions.push('.ts', '.tsx')
37+
38+
config.resolve.modules = ['node_modules', path.resolve(__dirname, '../src')]
39+
40+
return config
41+
},
1342
}

0 commit comments

Comments
 (0)