fix: add mobile .storybook

This commit is contained in:
毅羽 2021-01-04 22:14:54 +08:00 committed by Yanyan Wang
parent 851b17b52b
commit 3190e9682e
3 changed files with 48 additions and 2 deletions

4
.gitignore vendored
View File

@ -82,7 +82,7 @@ esm
es
.github
.storybook
# .storybook
.vscode/
stats.json
stats.json

View File

@ -0,0 +1,42 @@
module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials"
],
webpackFinal: async (config, { configType }) => {
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
// You can change the configuration based on that.
// 'PRODUCTION' is used when building the static version of storybook.
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('awesome-typescript-loader'),
});
config.module.rules.push(
{
test: /\.stories\.tsx?$/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
enforce: 'pre',
exclude: /node_modules | tests/,
},
);
config.resolve.extensions.push('.ts', '.tsx', '.js');
// Return the altered config
return config;
}
}

View File

@ -0,0 +1,4 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
}