graphql-engine/console/.storybook/main.js
Matt Hardman 0b2944993f console: add RS-to-RS widget component [CON-75]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4149
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: edadaf0afc6060146e3e55fa4dc55cf9d027011d
2022-04-06 06:11:12 +00:00

99 lines
2.6 KiB
JavaScript

const util = require('util');
const webpack = require('webpack');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const path = require('path');
const isConfigDebugMode = process.env.STORYBOOK_CONFIG_LOG === 'debug';
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
babel: async options => {
if (isConfigDebugMode) {
console.log('------BABEL--------');
console.log(util.inspect(options, { showHidden: false, depth: null }));
}
return options;
},
webpackFinal: async (config, rest) => {
const newConfig = {
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: /\.scss$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 2,
modules: {
localIdentName: '[local]___[hash:base64:5]',
},
},
},
{
loader: 'sass-loader',
options: {
// Prefer `dart-sass`
implementation: require('sass'),
sassOptions: {
outputStyle: 'expanded',
},
sourceMap: true,
},
},
],
},
],
},
plugins: [
...config.plugins,
new webpack.DefinePlugin({
CONSOLE_ASSET_VERSION: Date.now().toString(),
'process.hrtime': () => null,
__CLIENT__: true,
__SERVER__: false,
__DEVELOPMENT__: true,
__DEVTOOLS__: true, // <-------- DISABLE redux-devtools HERE
}),
],
resolve: {
...config.resolve,
plugins: [
...config.resolve.plugins,
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, '../tsconfig.json'),
}),
],
},
};
if (isConfigDebugMode) {
console.log('------WEBPACK--------');
console.log(util.inspect(newConfig, { showHidden: false, depth: null }));
}
// Return the altered config
return newConfig;
},
addons: [
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
features: {
interactionsDebugger: true,
},
};