Task #2677
Reduce bundle size
Start date:
04/21/2020
Due date:
% Done:
100%
History
#1 Updated by Luke Murphey over 4 years ago
Solns:
- [Fixed] Install https://babeljs.io/docs/en/babel-plugin-syntax-dynamic-import
- Compile completes but eslint still reports an error
- VScode is still reporting an error though
- [Fixed] Wrap the objects in Suspense (per https://reactjs.org/docs/code-splitting.html#reactlazy)
- This fixed the error when dynamically loading
- Configure eslint
- https://stackoverflow.com/questions/47815775/dynamic-imports-for-code-splitting-cause-eslint-parsing-error-import/47833471
- [No help] allowImportExportEverywhere: true
- [No help]
parserOptions: { extends: "standard", parser: "babel-eslint", },
- Why would it attempt to load the bundle under the URL of the site?
- I get the following error when I attempt to load /about:
Error: A React component suspended while rendering, but no fallback UI was specified. Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.
- Getting an error when I go to a work directly (http://localhost:8081/work/abdicatus)
An error happened and the view could not be rendered. Details ChunkLoadError: Loading chunk 1 failed. (missing: http://localhost:8081/work/1.bundle.js)
- Fixed by setting the publicPath: '/js/
- https://stackoverflow.com/questions/42574933/unexpected-token-import-during-npm-start-in-react?rq=1
- https://stackoverflow.com/questions/42804163/uncaught-syntaxerror-unexpected-token-import-in-reactjs-app
- With an old version of Webpack
- https://github.com/babel/babel-loader/issues/493
- Add syntax-dynamic-import
- https://stackoverflow.com/questions/55621561/syntaxerror-unexpected-token-import-reactjs/55621610
- https://stackoverflow.com/questions/55869376/why-do-i-have-an-unexpected-token-import-when-lazy-loading
- No help
- https://blog.jscrambler.com/how-to-make-your-app-faster-with-webpack-dynamic-imports/
- https://stackoverflow.com/questions/52329156/react-loadable-gets-chunks-only-from-relative-path
#2 Updated by Luke Murphey over 4 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 80
#3 Updated by Luke Murphey over 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 80 to 100