mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
1c942fe69e
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9006 Co-authored-by: Nicolas Inchauspe <710410+nicoinch@users.noreply.github.com> Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com> Co-authored-by: Daniele Cammareri <5709409+dancamma@users.noreply.github.com> Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com> Co-authored-by: Rishichandra Wawhal <27274869+wawhal@users.noreply.github.com> Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com> Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com> Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com> Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com> Co-authored-by: John Kiragu <11444316+kigsmtua@users.noreply.github.com> Co-authored-by: Matthew Goodwin <49927862+m4ttheweric@users.noreply.github.com> Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com> Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com> Co-authored-by: Aaysha <109507451+aayshasura@users.noreply.github.com> Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com> Co-authored-by: Erik Magnusson <32518962+ejkkan@users.noreply.github.com> GitOrigin-RevId: fe4953db62326fb3a8de118f8bba2add9bb9c2c2
65 lines
1.7 KiB
TypeScript
65 lines
1.7 KiB
TypeScript
import * as webpack from 'webpack';
|
|
import { merge } from 'webpack-merge';
|
|
export default {
|
|
addons: [
|
|
'@storybook/addon-links',
|
|
'@storybook/addon-interactions',
|
|
'@storybook/addon-a11y',
|
|
'storybook-addon-console-env',
|
|
'@storybook/addon-mdx-gfm',
|
|
],
|
|
webpackFinal: async (config: any) => {
|
|
const finalConfig = merge(config, {
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
__CLIENT__: 'true',
|
|
__SERVER__: false,
|
|
__DEVELOPMENT__: true,
|
|
__DEVTOOLS__: true,
|
|
// <-------- DISABLE redux-devtools HERE
|
|
CONSOLE_ASSET_VERSION: Date.now().toString(),
|
|
}),
|
|
// un comment this to test out the circular deps. Left here since it can be tricky to configure
|
|
],
|
|
|
|
resolve: {
|
|
fallback: {
|
|
fs: false,
|
|
os: false,
|
|
http: false,
|
|
path: require.resolve('path-browserify'),
|
|
crypto: false,
|
|
util: require.resolve('util/'),
|
|
stream: false,
|
|
url: false,
|
|
},
|
|
},
|
|
});
|
|
finalConfig.module.rules = finalConfig.module.rules.map((rule: any) => {
|
|
if (/source-map-loader/.test(rule.loader)) {
|
|
return {
|
|
...rule,
|
|
exclude: /node_modules/, // we don't want source maps for vendors, because of graphiql
|
|
};
|
|
}
|
|
|
|
if (/file-loader/.test(rule.loader)) {
|
|
return {
|
|
...rule,
|
|
type: 'javascript/auto', // This is fixing issue https://webpack.js.org/guides/asset-modules/
|
|
};
|
|
}
|
|
|
|
return rule;
|
|
});
|
|
return finalConfig;
|
|
},
|
|
framework: {
|
|
name: '@storybook/react-webpack5',
|
|
options: {},
|
|
},
|
|
docs: {
|
|
autodocs: true,
|
|
},
|
|
};
|