jaredpalmer / jaredpalmer/backpack

Dynamic import

Open
#84 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.4k
Forks
164
PR merge metrics
No merged PRs in 30d

Description

Importing my code-split React app gives me this annoying error:

![screen shot 2017-09-27 at 6 21 29 pm](https://user-images.githubusercontent.com/7525670/30924998-b652d5ca-a3b0-11e7-825b-319816d6c208.png)

Using `react-loadable` for the code splitting etc. Looking at `razzle` it should just be a matter of adding `babel-plugin-syntax-dynamic-import` to the Babel config?

https://github.com/jaredpalmer/razzle/blob/75966e3eb6177657c066a44b97e63870f5fa5eeb/packages/babel-preset-razzle/index.js#L21-L22

Contributor guide

Open the contributing guide

Research direction

Inspect Backpack's Babel configuration and compare it with the linked Razzle preset lines that add dynamic-import syntax support. Reproduce the React code-splitting error with react-loadable, then verify that the app builds and imports the split module without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript, react, webpack
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.