forked from awslabs/diagram-maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
48 lines (47 loc) · 1.41 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
43
44
45
46
47
48
import { StorybookConfig } from '@storybook/html-webpack5';
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const custom = require('../webpack.common');
const config: StorybookConfig = {
framework: {
name: "@storybook/html-webpack5",
options: {}
},
core: { disableTelemetry: true },
stories: ["../storybook/**/*.mdx", "../integ/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-essentials", "@storybook/addon-storysource"],
webpackFinal: async config => {
return {
...config,
module: {
...config.module,
rules: [...(config.module?.rules as any), ...custom.module.rules, {
test: /\.tsx?$/,
include: [/src/],
exclude: [/node_modules/, /\.spec\.tsx?$/],
enforce: 'post',
loader: 'babel-loader',
options: {
plugins: [["istanbul", {
"useInlineSourceMaps": false
}]]
}
}]
},
resolve: {
...config.resolve,
alias: {
...config.resolve?.alias,
...custom.resolve.alias
}
},
plugins: [
...(config.plugins as any),
new MiniCssExtractPlugin()
],
// This is because of a limitation in ts-loader
// https://github.com/TypeStrong/ts-loader#transpileonly-boolean-defaultfalse
ignoreWarnings: [/export .* was not found in/]
};
}
};
export default config;