Dva: redux-saga bundled twice with dva

Created on 2 Dec 2017  ·  7Comments  ·  Source: dvajs/dva

using BundleAnalyzerPlugin with webpack i discovered that a typical dva project includes both es and lib dir for redux-saga check here: https://i.imgur.com/HN25T20.png

I tried with ant-design-pro as well with same result

expect only es dir to be used when i bundle locally.

Most helpful comment

Issue seem to be here:

https://github.com/dvajs/dva/blob/master/packages/dva-core/src/getSaga.js

import * as sagaEffects from 'redux-saga/effects'; imports from redux-saga/es
import { takeEveryHelper as takeEvery, takeLatestHelper as takeLatest, throttleHelper as throttle, } from 'redux-saga/lib/internal/sagaHelpers'; imports from redux-saga/lib

There is one more lib reference in https://github.com/dvajs/dva/blob/master/packages/dva-core/src/index.js

Also suggestion to upgrade redux-saga

All 7 comments

example repo

https://github.com/andriijas/create-react-app-playground

npm run build and check build/report.html

I think you should delete "redux-saga" in config-overrides.js.

from the item of "vendors " .

Same results.

Maybe its issue with redux-saga but I can see that there are references to redux-saga/lib in dva.

you can also check dist/saga.js in dva, its 96k

Issue seem to be here:

https://github.com/dvajs/dva/blob/master/packages/dva-core/src/getSaga.js

import * as sagaEffects from 'redux-saga/effects'; imports from redux-saga/es
import { takeEveryHelper as takeEvery, takeLatestHelper as takeLatest, throttleHelper as throttle, } from 'redux-saga/lib/internal/sagaHelpers'; imports from redux-saga/lib

There is one more lib reference in https://github.com/dvajs/dva/blob/master/packages/dva-core/src/index.js

Also suggestion to upgrade redux-saga

Was this page helpful?
0 / 5 - 0 ratings