From 913ff0375a9ee8f99a5302f9b9a92913583e4065 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Tue, 5 Mar 2019 11:04:53 -0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20enable=20hot=20reload?= =?UTF-8?q?=20for=20typescript=20in=20storybook=20(#9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../storybook-config/webpack.config.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook-config/webpack.config.js b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook-config/webpack.config.js index 465c10060c2ad..f0d253ff55948 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook-config/webpack.config.js +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook-config/webpack.config.js @@ -8,12 +8,16 @@ module.exports = (storybookBaseConfig, configType, defaultConfig) => { // You can change the configuration based on that. // 'PRODUCTION' is used when building the static version of storybook. + /* eslint-disable-next-line */ defaultConfig.resolve = defaultConfig.resolve || {}; + /* eslint-disable-next-line */ defaultConfig.resolve.extensions = ['.ts', '.tsx', '.js', '.jsx']; - defaultConfig.plugins.push(new ForkTsCheckerWebpackPlugin({ - checkSyntacticErrors: true, - })); + defaultConfig.plugins.push( + new ForkTsCheckerWebpackPlugin({ + checkSyntacticErrors: true, + }), + ); defaultConfig.module.rules[0].use[0].options.plugins.push('@babel/plugin-syntax-dynamic-import'); @@ -31,7 +35,7 @@ module.exports = (storybookBaseConfig, configType, defaultConfig) => { { loader: 'thread-loader', options: { - // there should be 1 cpu for the fork-ts-checker-webpack-plugin + // there should be 1 cpu for the fork-ts-checker-webpack-plugin workers: os.cpus().length - 1, }, }, @@ -48,4 +52,4 @@ module.exports = (storybookBaseConfig, configType, defaultConfig) => { // Return the altered config return defaultConfig; -}; +}; \ No newline at end of file