Issue with loadable
shavo007 opened this issue · comments
Code splitting by route, get test failure
Summary of all failing tests
FAIL src/App/App.spec.js
● Test suite failed to run
/Users/slee/projects/adv-account-management-ui/node_modules/sku/@loadable/component/index.ts:3
import loadable, { loadableReady } from '@loadable/component';
^^^^^^^^
SyntaxError: Unexpected identifier
16 | import UnhandledErrorPage from './UnhandledErrorPage';
17 | import { trackOnce } from 'src/utils/trackError';
> 18 | import loadable from 'sku/@loadable/component';
| ^
19 |
20 | import {
21 | selectIsPendingActivation,
at ScriptTransformer._transformAndBuildScript (node_modules/jest/node_modules/@jest/transform/build/ScriptTransformer.js:471:17)
at Object.<anonymous> (src/App/App.js:18:1)
sku version 8.5.0
sample usage in App.js
import loadable from 'sku/@loadable/component';
// code splitting by route
);
const LoadableNoMatchPage = loadable(() =>
import(/* webpackChunkName: "nomatch-page"*/ './NoMatchPage'),
);
<Switch>
<Route component={LoadableNoMatchPage} />
</Switch>