-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathmain.ts
42 lines (37 loc) · 1.11 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
// import '../src/styles/reset.css'
module.exports = {
core: {
builder: 'webpack4',
},
stories: ['../stories/Temp.stories.tsx', '../stories/Error.stories.tsx'],
addons: ['@storybook/addon-actions', '@storybook/addon-knobs', '@storybook/addon-links'],
babel: async (options) => ({
...options,
presets: [...options.presets, '@emotion/babel-preset-css-prop', '@babel/preset-react'],
plugins: [
[
'import',
{
libraryName: '@alifd/next',
style: true,
},
],
],
}),
webpackFinal: (config) => {
config.module.rules.push({
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
})
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('babel-loader'),
})
config.plugins.push(new MiniCssExtractPlugin({ filename: '[name].css' }))
config.resolve.extensions.push('.ts', '.tsx')
config.resolve.modules = ['node_modules', path.resolve(__dirname, '../src')]
return config
},
}