Skip to content

Commit

Permalink
improve perf with built in loader for TS
Browse files Browse the repository at this point in the history
- remove `ts-loader` as not necessary
- plus some settings for Storybook's TS loader preset

Signed-off-by: Anton Gilgur <[email protected]>
  • Loading branch information
agilgur5 committed Jul 19, 2024
1 parent eb27259 commit 8a3ec46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
8 changes: 5 additions & 3 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ const path = require('path');
module.exports = {
stories: ['../stories/*.stories.tsx'],
addons: ['@storybook/addon-essentials'],
typescript: {
check: false, // typecheck separately
reactDocgen: false, // substantially improves performance: https://github.com/storybookjs/storybook/issues/22164#issuecomment-1603627308
},
webpackFinal: async (config, {configType}) => {
config.devtool = false; // perf per: https://github.com/storybookjs/storybook/issues/19736#issuecomment-1478103817
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: 'ts-loader'
}, {
test: /\.scss$/,
exclude: /node_modules/,
include: path.resolve(__dirname, '../'),
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"storybook": "^6.5.14",
"style-loader": "^2.0.0",
"ts-jest": "^26.5.6",
"ts-loader": "^8.3.0",
"ts-node": "^10.9.1",
"webfonts-generator": "^0.4.0",
"webpack": "^4.46.0"
Expand Down
15 changes: 2 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6143,7 +6143,7 @@ endent@^2.0.1:
fast-json-parse "^1.0.3"
objectorarray "^1.0.4"

enhanced-resolve@^4.0.0, enhanced-resolve@^4.5.0:
enhanced-resolve@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz#2f3cfd84dbe3b487f18f2db2ef1e064a571ca5ec"
integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==
Expand Down Expand Up @@ -9890,7 +9890,7 @@ micromatch@^3.1.10, micromatch@^3.1.4:
snapdragon "^0.8.1"
to-regex "^3.0.2"

micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4:
micromatch@^4.0.2, micromatch@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9"
integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==
Expand Down Expand Up @@ -13706,17 +13706,6 @@ ts-jest@^26.5.6:
semver "7.x"
yargs-parser "20.x"

ts-loader@^8.3.0:
version "8.4.0"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-8.4.0.tgz#e845ea0f38d140bdc3d7d60293ca18d12ff2720f"
integrity sha512-6nFY3IZ2//mrPc+ImY3hNWx1vCHyEhl6V+wLmL4CZcm6g1CqX7UKrkc6y0i4FwcfOhxyMPCfaEvh20f4r9GNpw==
dependencies:
chalk "^4.1.0"
enhanced-resolve "^4.0.0"
loader-utils "^2.0.0"
micromatch "^4.0.0"
semver "^7.3.4"

ts-node@^10.9.1:
version "10.9.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b"
Expand Down

0 comments on commit 8a3ec46

Please sign in to comment.