2024-02-15 09:40:17 -05:00
|
|
|
import { dirname, join } from 'path';
|
2020-07-22 13:21:25 -04:00
|
|
|
/**
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
* or more contributor license agreements. See the NOTICE file
|
|
|
|
* distributed with this work for additional information
|
|
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
|
|
* to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
2021-07-26 12:30:35 -04:00
|
|
|
// Superset's webpack.config.js
|
2020-07-22 13:21:25 -04:00
|
|
|
const customConfig = require('../webpack.config.js');
|
|
|
|
|
|
|
|
module.exports = {
|
2022-01-20 09:35:09 -05:00
|
|
|
stories: [
|
2023-03-24 06:03:55 -04:00
|
|
|
'../src/@(components|common|filters|explore|views|dashboard|features)/**/*.stories.@(tsx|jsx)',
|
2024-02-15 09:40:17 -05:00
|
|
|
'../packages/superset-ui-demo/storybook/stories/**/*.*.@(tsx|jsx)',
|
2022-01-20 09:35:09 -05:00
|
|
|
],
|
2024-02-15 09:40:17 -05:00
|
|
|
|
2020-07-22 13:21:25 -04:00
|
|
|
addons: [
|
2024-02-15 09:40:17 -05:00
|
|
|
getAbsolutePath('@storybook/addon-essentials'),
|
|
|
|
getAbsolutePath('@storybook/addon-links'),
|
|
|
|
getAbsolutePath('storybook-addon-jsx'),
|
|
|
|
getAbsolutePath('@storybook/addon-controls'),
|
|
|
|
getAbsolutePath('@storybook/addon-mdx-gfm'),
|
2020-07-22 13:21:25 -04:00
|
|
|
],
|
2024-02-15 09:40:17 -05:00
|
|
|
|
2022-03-28 13:02:47 -04:00
|
|
|
staticDirs: ['../src/assets/images'],
|
2024-02-15 09:40:17 -05:00
|
|
|
|
2020-07-22 13:21:25 -04:00
|
|
|
webpackFinal: config => ({
|
|
|
|
...config,
|
|
|
|
module: {
|
|
|
|
...config.module,
|
|
|
|
rules: customConfig.module.rules,
|
|
|
|
},
|
2020-08-05 01:39:14 -04:00
|
|
|
resolve: {
|
|
|
|
...config.resolve,
|
|
|
|
...customConfig.resolve,
|
|
|
|
},
|
2020-07-22 13:21:25 -04:00
|
|
|
plugins: [...config.plugins, ...customConfig.plugins],
|
|
|
|
}),
|
2024-02-15 09:40:17 -05:00
|
|
|
|
2021-07-22 19:30:25 -04:00
|
|
|
typescript: {
|
2022-08-17 13:39:44 -04:00
|
|
|
reactDocgen: 'react-docgen-typescript',
|
2021-07-22 19:30:25 -04:00
|
|
|
},
|
2024-02-15 09:40:17 -05:00
|
|
|
|
|
|
|
framework: {
|
|
|
|
name: getAbsolutePath('@storybook/react-webpack5'),
|
|
|
|
options: {},
|
|
|
|
},
|
|
|
|
|
|
|
|
docs: {
|
|
|
|
autodocs: false,
|
|
|
|
},
|
2020-08-02 17:32:17 -04:00
|
|
|
};
|
2024-02-15 09:40:17 -05:00
|
|
|
|
|
|
|
function getAbsolutePath(value) {
|
|
|
|
return dirname(require.resolve(join(value, 'package.json')));
|
|
|
|
}
|