@storybook/preset-create-react-app 4.0.1 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +107 -57
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/package.json +2 -2
- package/CHANGELOG.md +0 -73
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ One-line [Create React App](https://github.com/facebook/create-react-app) config
|
|
|
4
4
|
|
|
5
5
|
This preset is designed to use alongside [`@storybook/react`](https://github.com/storybookjs/storybook/tree/master/app/react).
|
|
6
6
|
|
|
7
|
+
## Compatibility
|
|
8
|
+
|
|
9
|
+
This version (4.x) of `@storybook/preset-create-react-app` is compatibly with Create React App version 5 and above. Earlier versions are compatible with earlier version of the preset.
|
|
10
|
+
|
|
7
11
|
## Basic usage
|
|
8
12
|
|
|
9
13
|
**Note: you don't need to do this manually** if you used `npx -p @storybook/cli sb init` on a create-react-app, everything should properly setup already ✅.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
2
|
import { PluginOptions } from './types';
|
|
3
|
-
export declare const core: (
|
|
3
|
+
export declare const core: (existing: {
|
|
4
|
+
disableWebpackDefaults: boolean;
|
|
5
|
+
}) => {
|
|
4
6
|
disableWebpackDefaults: boolean;
|
|
5
7
|
};
|
|
6
8
|
export declare const babelDefault: () => Record<string, (string | [string, object])[]>;
|
|
7
9
|
export declare const managerWebpack: (webpackConfig?: Configuration) => Configuration;
|
|
8
|
-
export declare const webpack: (webpackConfig: Configuration | undefined, options: PluginOptions) => Configuration
|
|
10
|
+
export declare const webpack: (webpackConfig: Configuration | undefined, options: PluginOptions) => Promise<Configuration>;
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
13
49
|
var __read = (this && this.__read) || function (o, n) {
|
|
14
50
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
51
|
if (!m) return o;
|
|
@@ -60,9 +96,8 @@ var resolveLoader = {
|
|
|
60
96
|
plugins: [pnp_webpack_plugin_1.default.moduleLoader(module)],
|
|
61
97
|
};
|
|
62
98
|
// TODO: Replace with exported type from Storybook.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}); };
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
100
|
+
var core = function (existing) { return (__assign(__assign({}, existing), { disableWebpackDefaults: true })); };
|
|
66
101
|
exports.core = core;
|
|
67
102
|
// Don't use Storybook's default Babel config.
|
|
68
103
|
var babelDefault = function () { return ({
|
|
@@ -78,62 +113,77 @@ var managerWebpack = function (webpackConfig) {
|
|
|
78
113
|
exports.managerWebpack = managerWebpack;
|
|
79
114
|
// Update the core Webpack config.
|
|
80
115
|
var webpack = function (webpackConfig, options) {
|
|
81
|
-
var _a, _b;
|
|
82
116
|
if (webpackConfig === void 0) { webpackConfig = {}; }
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
118
|
+
var scriptsPath, scriptsPackageName, filteredRules, craWebpackConfigPath, craWebpackConfig, craRules, isStorybook6, _a, typescriptOptions, tsDocgenPlugin, isProd, coreOptions, builderOptions, cacheConfig, lazyCompilationConfig;
|
|
119
|
+
var _b, _c, _d;
|
|
120
|
+
return __generator(this, function (_e) {
|
|
121
|
+
switch (_e.label) {
|
|
122
|
+
case 0:
|
|
123
|
+
scriptsPath = REACT_SCRIPTS_PATH;
|
|
124
|
+
// Flag any potentially conflicting presets.
|
|
125
|
+
checkPresets_1.checkPresets(options);
|
|
126
|
+
scriptsPackageName = options[OPTION_SCRIPTS_PACKAGE];
|
|
127
|
+
if (typeof scriptsPackageName === 'string') {
|
|
128
|
+
try {
|
|
129
|
+
scriptsPath = path_1.dirname(require.resolve(scriptsPackageName + "/package.json", {
|
|
130
|
+
paths: [options.configDir],
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
catch (e) {
|
|
134
|
+
node_logger_1.logger.warn("A `" + OPTION_SCRIPTS_PACKAGE + "` was provided, but couldn't be resolved.");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// If there isn't a scripts-path set, return the Webpack config unmodified.
|
|
138
|
+
if (!scriptsPath) {
|
|
139
|
+
node_logger_1.logger.error('Failed to resolve a `react-scripts` package.');
|
|
140
|
+
return [2 /*return*/, webpackConfig];
|
|
141
|
+
}
|
|
142
|
+
node_logger_1.logger.info("=> Loading Webpack configuration from `" + path_1.relative(CWD, scriptsPath) + "`");
|
|
143
|
+
// Remove existing rules related to JavaScript and TypeScript.
|
|
144
|
+
node_logger_1.logger.info("=> Removing existing JavaScript and TypeScript rules.");
|
|
145
|
+
filteredRules = webpackConfig.module &&
|
|
146
|
+
webpackConfig.module.rules.filter(function (_a) {
|
|
147
|
+
var test = _a.test;
|
|
148
|
+
return !(test instanceof RegExp &&
|
|
149
|
+
((test && test.test('.js')) || test.test('.ts')));
|
|
150
|
+
});
|
|
151
|
+
craWebpackConfigPath = path_1.join(scriptsPath, 'config', 'webpack.config');
|
|
152
|
+
craWebpackConfig = require(craWebpackConfigPath)(webpackConfig.mode);
|
|
153
|
+
// Select the relevant CRA rules and add the Storybook config directory.
|
|
154
|
+
node_logger_1.logger.info("=> Modifying Create React App rules.");
|
|
155
|
+
craRules = processCraConfig_1.processCraConfig(craWebpackConfig, options);
|
|
156
|
+
isStorybook6 = semver_1.default.gte(options.packageJson.version || '', '6.0.0');
|
|
157
|
+
_a = options.typescriptOptions, typescriptOptions = _a === void 0 ? {
|
|
158
|
+
reactDocgen: 'react-docgen-typescript',
|
|
159
|
+
reactDocgenTypescriptOptions: {},
|
|
160
|
+
} : _a;
|
|
161
|
+
tsDocgenPlugin = !isStorybook6 && typescriptOptions.reactDocgen === 'react-docgen-typescript'
|
|
162
|
+
? [
|
|
163
|
+
new react_docgen_typescript_plugin_1.default(typescriptOptions.reactDocgenTypescriptOptions),
|
|
164
|
+
]
|
|
165
|
+
: [];
|
|
166
|
+
isProd = webpackConfig.mode !== 'development';
|
|
167
|
+
return [4 /*yield*/, options.presets.apply('core')];
|
|
168
|
+
case 1:
|
|
169
|
+
coreOptions = _e.sent();
|
|
170
|
+
builderOptions = (_b = coreOptions === null || coreOptions === void 0 ? void 0 : coreOptions.builder) === null || _b === void 0 ? void 0 : _b.options;
|
|
171
|
+
cacheConfig = (builderOptions === null || builderOptions === void 0 ? void 0 : builderOptions.fsCache)
|
|
172
|
+
? { cache: { type: 'filesystem' } }
|
|
173
|
+
: {};
|
|
174
|
+
lazyCompilationConfig = (builderOptions === null || builderOptions === void 0 ? void 0 : builderOptions.lazyCompilation) && !isProd
|
|
175
|
+
? { experiments: { lazyCompilation: { entries: false } } }
|
|
176
|
+
: {};
|
|
177
|
+
// Return the new config.
|
|
178
|
+
return [2 /*return*/, __assign(__assign(__assign(__assign({}, webpackConfig), cacheConfig), lazyCompilationConfig), { module: __assign(__assign({}, webpackConfig.module), { rules: __spreadArray(__spreadArray([], __read((filteredRules || []))), __read(craRules)) }),
|
|
179
|
+
// NOTE: this prioritizes the storybook version of a plugin
|
|
180
|
+
// when there are duplicates between SB and CRA
|
|
181
|
+
plugins: mergePlugins_1.mergePlugins.apply(void 0, __spreadArray(__spreadArray(__spreadArray([], __read((webpackConfig.plugins || []))), __read(((_c = craWebpackConfig.plugins) !== null && _c !== void 0 ? _c : []))), __read(tsDocgenPlugin))), resolve: __assign(__assign({}, webpackConfig.resolve), { extensions: (_d = craWebpackConfig.resolve) === null || _d === void 0 ? void 0 : _d.extensions, modules: __spreadArray(__spreadArray(__spreadArray([], __read(((webpackConfig.resolve && webpackConfig.resolve.modules) || []))), [
|
|
182
|
+
path_1.join(REACT_SCRIPTS_PATH, 'node_modules')
|
|
183
|
+
]), __read(getModulePath_1.getModulePath(CWD))), plugins: [pnp_webpack_plugin_1.default] }), resolveLoader: resolveLoader })];
|
|
184
|
+
}
|
|
111
185
|
});
|
|
112
|
-
|
|
113
|
-
var craWebpackConfigPath = path_1.join(scriptsPath, 'config', 'webpack.config');
|
|
114
|
-
// eslint-disable-next-line global-require, import/no-dynamic-require, @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-call
|
|
115
|
-
var craWebpackConfig = require(craWebpackConfigPath)(webpackConfig.mode);
|
|
116
|
-
// Select the relevant CRA rules and add the Storybook config directory.
|
|
117
|
-
node_logger_1.logger.info("=> Modifying Create React App rules.");
|
|
118
|
-
var craRules = processCraConfig_1.processCraConfig(craWebpackConfig, options);
|
|
119
|
-
// NOTE: These are set by default in Storybook 6.
|
|
120
|
-
var isStorybook6 = semver_1.default.gte(options.packageJson.version || '', '6.0.0');
|
|
121
|
-
var _c = options.typescriptOptions, typescriptOptions = _c === void 0 ? {
|
|
122
|
-
reactDocgen: 'react-docgen-typescript',
|
|
123
|
-
reactDocgenTypescriptOptions: {},
|
|
124
|
-
} : _c;
|
|
125
|
-
var tsDocgenPlugin = !isStorybook6 && typescriptOptions.reactDocgen === 'react-docgen-typescript'
|
|
126
|
-
? [
|
|
127
|
-
new react_docgen_typescript_plugin_1.default(typescriptOptions.reactDocgenTypescriptOptions),
|
|
128
|
-
]
|
|
129
|
-
: [];
|
|
130
|
-
// Return the new config.
|
|
131
|
-
return __assign(__assign({}, webpackConfig), { module: __assign(__assign({}, webpackConfig.module), { rules: __spreadArray(__spreadArray([], __read((filteredRules || []))), __read(craRules)) }),
|
|
132
|
-
// NOTE: this prioritizes the storybook version of a plugin
|
|
133
|
-
// when there are duplicates between SB and CRA
|
|
134
|
-
plugins: mergePlugins_1.mergePlugins.apply(void 0, __spreadArray(__spreadArray(__spreadArray([], __read((webpackConfig.plugins || []))), __read(((_a = craWebpackConfig.plugins) !== null && _a !== void 0 ? _a : []))), __read(tsDocgenPlugin))), resolve: __assign(__assign({}, webpackConfig.resolve), { extensions: (_b = craWebpackConfig.resolve) === null || _b === void 0 ? void 0 : _b.extensions, modules: __spreadArray(__spreadArray(__spreadArray([], __read(((webpackConfig.resolve && webpackConfig.resolve.modules) || []))), [
|
|
135
|
-
path_1.join(REACT_SCRIPTS_PATH, 'node_modules')
|
|
136
|
-
]), __read(getModulePath_1.getModulePath(CWD))), plugins: [pnp_webpack_plugin_1.default] }), resolveLoader: resolveLoader });
|
|
186
|
+
});
|
|
137
187
|
};
|
|
138
188
|
exports.webpack = webpack;
|
|
139
189
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src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W,EAAE,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;wBAC1D,CAAC,CAAC,EAAE,CAAC;oBAET,yBAAyB;oBACzB,8DACK,aAAa,GACb,WAAW,GACX,qBAAqB,KACxB,MAAM,wBACD,aAAa,CAAC,MAAM,KACvB,KAAK,yCAAM,CAAC,aAAa,IAAI,EAAE,CAAC,WAAK,QAAQ;4BAE/C,2DAA2D;4BAC3D,+CAA+C;4BAC/C,OAAO,EAAE,2BAAY,oEAChB,CAAC,aAAa,CAAC,OAAO,IAAI,EAAE,CAAC,WAC7B,CAAC,MAAA,gBAAgB,CAAC,OAAO,mCAAI,EAAE,CAAC,WAChC,cAAc,KAEnB,OAAO,wBACF,aAAa,CAAC,OAAO,KACxB,UAAU,EAAE,MAAA,gBAAgB,CAAC,OAAO,0CAAE,UAAU,EAChD,OAAO,uDACF,CAAC,CAAC,aAAa,CAAC,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;oCACnE,WAAI,CAAC,kBAAkB,EAAE,cAAc,CAAC;2CACrC,6BAAa,CAAC,GAAG,CAAC,IAEvB,OAAO,EAAE,CAAC,4BAA4C,CAAC,KAEzD,aAAa,eAAA,KACb;;;;CACH,CAAC;AAvHW,QAAA,OAAO,WAuHlB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -29,4 +29,15 @@ export interface PluginOptions {
|
|
|
29
29
|
reactDocgen: 'react-docgen-typescript' | 'react-docgen' | false;
|
|
30
30
|
reactDocgenTypescriptOptions: RDTSPluginOptions;
|
|
31
31
|
};
|
|
32
|
+
presets: {
|
|
33
|
+
apply<T>(preset: Preset): Promise<T>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface CoreConfig {
|
|
37
|
+
builder: {
|
|
38
|
+
options?: {
|
|
39
|
+
fsCache?: boolean;
|
|
40
|
+
lazyCompilation?: boolean;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
32
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/preset-create-react-app",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Create React App preset for Storybook",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@babel/core": "*",
|
|
41
41
|
"@storybook/node-logger": "*",
|
|
42
42
|
"@storybook/react": ">=5.2",
|
|
43
|
-
"react-scripts": ">=
|
|
43
|
+
"react-scripts": ">=5.0.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
package/CHANGELOG.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
## 4.0.1
|
|
2
|
-
|
|
3
|
-
- Support CJS files using Storybook's config [#229](https://github.com/storybookjs/presets/pull/229)
|
|
4
|
-
|
|
5
|
-
## 4.0.0
|
|
6
|
-
|
|
7
|
-
- CRA: Add compatibility for CRA v5 [#214](https://github.com/storybookjs/presets/pull/214)
|
|
8
|
-
|
|
9
|
-
## 3.2.0
|
|
10
|
-
|
|
11
|
-
- Add disableWebpackDefaults for forward-compatibility with SB core
|
|
12
|
-
|
|
13
|
-
## 3.1.7
|
|
14
|
-
|
|
15
|
-
- CRA: Fix fast refresh config [#193](https://github.com/storybookjs/presets/pull/193)
|
|
16
|
-
|
|
17
|
-
## 3.1.6
|
|
18
|
-
|
|
19
|
-
- Fix monorepos and PnP [#181](https://github.com/storybookjs/presets/pull/181)
|
|
20
|
-
|
|
21
|
-
## 3.1.5
|
|
22
|
-
|
|
23
|
-
- Fix duplicate ReactDocgenTypescriptPlugin [#173](https://github.com/storybookjs/presets/pull/173)
|
|
24
|
-
- Bump react-docgen-typescript-plugin to 0.6.2 [#174](https://github.com/storybookjs/presets/pull/174)
|
|
25
|
-
|
|
26
|
-
## 3.1.4
|
|
27
|
-
|
|
28
|
-
- Upgrade react-docgen-typescript-plugin to 0.5.x [#158](https://github.com/storybookjs/presets/pull/158)
|
|
29
|
-
|
|
30
|
-
## 3.1.3
|
|
31
|
-
|
|
32
|
-
- Move node-logger to peer deps [#156](https://github.com/storybookjs/presets/pull/156)
|
|
33
|
-
|
|
34
|
-
## 3.1.2
|
|
35
|
-
|
|
36
|
-
- Restore node@10 compatibility [#154](https://github.com/storybookjs/presets/pull/154)
|
|
37
|
-
|
|
38
|
-
## 3.1.1
|
|
39
|
-
|
|
40
|
-
- Fix react-docgen-typescript-plugin deps [#151](https://github.com/storybookjs/presets/pull/151)
|
|
41
|
-
|
|
42
|
-
## 3.1.0
|
|
43
|
-
|
|
44
|
-
- Move to react-docgen-typescript-plugin [#149](https://github.com/storybookjs/presets/pull/149)
|
|
45
|
-
|
|
46
|
-
## 3.0.1
|
|
47
|
-
|
|
48
|
-
- Ignore default babel Config from Storybook [#147](https://github.com/storybookjs/presets/pull/147)
|
|
49
|
-
|
|
50
|
-
## 3.0.0
|
|
51
|
-
|
|
52
|
-
Reverse course on typescript docgen handling [#142](https://github.com/storybookjs/presets/pull/142)
|
|
53
|
-
|
|
54
|
-
- Add back `react-docgen-typescript-loader` to the preset
|
|
55
|
-
- Add compatibility with SB6's main.js `typescript` setting
|
|
56
|
-
|
|
57
|
-
## 2.1.2
|
|
58
|
-
|
|
59
|
-
- Make `@storybook/node-logger` dependency less strict [#138](https://github.com/storybookjs/presets/pull/138)
|
|
60
|
-
|
|
61
|
-
## 2.1.1
|
|
62
|
-
|
|
63
|
-
- Set PUBLIC_URL if not set [#104](https://github.com/storybookjs/presets/pull/104)
|
|
64
|
-
|
|
65
|
-
## 2.1.0
|
|
66
|
-
|
|
67
|
-
- Yarn PNP compatibility [#104](https://github.com/storybookjs/presets/pull/104)
|
|
68
|
-
|
|
69
|
-
## 2.0.0
|
|
70
|
-
|
|
71
|
-
- Remove `react-docgen-typescript-loader` from the preset [#103](https://github.com/storybookjs/presets/pull/103)
|
|
72
|
-
|
|
73
|
-
Starting in `v5.x`, `react-docgen` supports typescript natively, so we no longer recommend `react-docgen-typescript-loader` and have removed it from the preset. This is a breaking change and the migration is documented in [Storybook](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-prop-tables-with-typescript).
|