Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(chore): address build issue #380

Merged
merged 5 commits into from
Oct 20, 2018
Merged

fix(chore): address build issue #380

merged 5 commits into from
Oct 20, 2018

Conversation

kuzhelov
Copy link
Contributor

@kuzhelov kuzhelov commented Oct 19, 2018

Problem

This PR aims to address the following warning that prevents bits from being published:

image

Cause

Root cause of this problem is that typescript bits are exported different way for compiler of version 3.1.* - specifically, dynamic import expressions are used for modules (examples provided below) that drives webpack into frustration (webpack/webpack#196).

image

And even given that production bundle size had remained to be almost exactly the same (7.35 -> 7.47MB), this fact results in webpack warning that fails build.

Was

image

Now

image

Solution

Use ContextReplacementPlugin to explicitly suggest the files that should be statically analysed by Webpack for bundling. With this approach

  • 👍 robust solution for handling dynamic imports in TS package is introduced
  • 👍 TS version is upgraded for the direct consumers of the library - this is necessary to eliminate --skipLibCheck requirement from client's projects

@codecov
Copy link

codecov bot commented Oct 19, 2018

Codecov Report

Merging #380 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #380   +/-   ##
=======================================
  Coverage   90.55%   90.55%           
=======================================
  Files          67       67           
  Lines        1334     1334           
  Branches      169      194   +25     
=======================================
  Hits         1208     1208           
  Misses        123      123           
  Partials        3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d92b3d...ffe200b. Read the comment docs.

@kuzhelov kuzhelov added 🚀 ready for review 🧰 fix Introduces fix for broken behavior. labels Oct 19, 2018
@levithomason levithomason merged commit 9c54734 into master Oct 20, 2018
@levithomason levithomason deleted the fix/publish-issue branch October 20, 2018 00:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧰 fix Introduces fix for broken behavior. 🚀 ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants