mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 19:58:46 +08:00
fix: add mobile .storybook
This commit is contained in:
parent
851b17b52b
commit
3190e9682e
4
.gitignore
vendored
4
.gitignore
vendored
@ -82,7 +82,7 @@ esm
|
||||
es
|
||||
|
||||
.github
|
||||
.storybook
|
||||
# .storybook
|
||||
.vscode/
|
||||
|
||||
stats.json
|
||||
stats.json
|
||||
|
42
packages/mobile/.storybook/main.js
Normal file
42
packages/mobile/.storybook/main.js
Normal 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;
|
||||
}
|
||||
}
|
4
packages/mobile/.storybook/preview.js
Normal file
4
packages/mobile/.storybook/preview.js
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
}
|
Loading…
Reference in New Issue
Block a user