mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Merge pull request #17141 from storybookjs/fix/ie11AgainAndAgainAndAgain
Core: Fix IE support by transpiling more libs to es5
This commit is contained in:
commit
d3adeb8644
@ -121,12 +121,15 @@ export const Panel: React.FC<AddonPanelProps> = (props) => {
|
||||
|
||||
const endRef = React.useRef();
|
||||
React.useEffect(() => {
|
||||
const observer = new global.window.IntersectionObserver(
|
||||
([end]: any) => setScrollTarget(end.isIntersecting ? undefined : end.target),
|
||||
{ root: global.window.document.querySelector('#panel-tab-content') }
|
||||
);
|
||||
if (endRef.current) observer.observe(endRef.current);
|
||||
return () => observer.disconnect();
|
||||
let observer: IntersectionObserver;
|
||||
if (global.window.IntersectionObserver) {
|
||||
observer = new global.window.IntersectionObserver(
|
||||
([end]: any) => setScrollTarget(end.isIntersecting ? undefined : end.target),
|
||||
{ root: global.window.document.querySelector('#panel-tab-content') }
|
||||
);
|
||||
if (endRef.current) observer.observe(endRef.current);
|
||||
}
|
||||
return () => observer?.disconnect();
|
||||
}, []);
|
||||
|
||||
const emit = useChannel(
|
||||
|
@ -4,6 +4,7 @@ import { getStorybookBabelConfig } from './babel';
|
||||
const { plugins } = getStorybookBabelConfig();
|
||||
|
||||
const nodeModulesThatNeedToBeParsedBecauseTheyExposeES6 = [
|
||||
'@storybook[\\\\/]expect',
|
||||
'@storybook[\\\\/]node_logger',
|
||||
'@testing-library[\\\\/]dom',
|
||||
'@testing-library[\\\\/]user-event',
|
||||
@ -22,14 +23,18 @@ const nodeModulesThatNeedToBeParsedBecauseTheyExposeES6 = [
|
||||
'find-up',
|
||||
'fs-extra',
|
||||
'highlight.js',
|
||||
'jest-mock',
|
||||
'json5',
|
||||
'node-fetch',
|
||||
'pkg-dir',
|
||||
'prettier',
|
||||
'pretty-format',
|
||||
'react-router',
|
||||
'react-router-dom',
|
||||
'resolve-from',
|
||||
'semver',
|
||||
'slash',
|
||||
'strip-ansi',
|
||||
].map((n) => new RegExp(`[\\\\/]node_modules[\\\\/]${n}`));
|
||||
|
||||
export const es6Transpiler: () => RuleSetRule = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user