You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forgive me if I've misconfigured something, but it seems like if I import {Toggle} from 'react-powerplug' in chunk A and import {Interval} from 'react-powerplug' in chunk B, all of the react-powerplug code winds up in chunk A, because react-powerplug exports a single rollup bundled js module.
If the current behavior is a bug, please provide the steps to reproduce.
Code for react-powerplug's Toggle winds up in main.js, and code for Interval winds up in 1.js.
Given that it's becoming popular to release packages as rollup bundles, I want to make sure webpack will be able to include part of that rollup bundle in one chunk, and another part of the bundle in another.
Bug report
What is the current behavior?
Forgive me if I've misconfigured something, but it seems like if I
import {Toggle} from 'react-powerplug'
in chunk A andimport {Interval} from 'react-powerplug'
in chunk B, all of thereact-powerplug
code winds up in chunk A, becausereact-powerplug
exports a single rollup bundled js module.If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/jedwards1211/webpack-code-splitting-issue
just clone,
yarn install
and runwebpack
. The outputdist/main.js
will contain all of the code being used fromreact-powerplug
; thedist/1.js
chunk importsInterval
frommain.js
.Here is what the relevant code looks like:
src/index.js
The output
dist/main.js
on my machine contained all of the code I used fromreact-powerplug
, whereasdist/1.js
just importsInterval
frommain.js
:src/chunk-b.js
What is the expected behavior?
Code for
react-powerplug
'sToggle
winds up inmain.js
, and code forInterval
winds up in1.js
.Given that it's becoming popular to release packages as rollup bundles, I want to make sure webpack will be able to include part of that rollup bundle in one chunk, and another part of the bundle in another.
Other relevant information:
webpack version: 4.16.2
Node.js version: 8
Operating System: macOS
The text was updated successfully, but these errors were encountered: