Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct module when using multiple modules versions #25

Merged
merged 2 commits into from
Jul 19, 2017

Conversation

mastilver
Copy link
Owner

No description provided.

@mastilver mastilver changed the title Fix multiple version loaded fix: use correct module when using multiple modules versions Jul 19, 2017
@mastilver mastilver force-pushed the fix-multiple-version-loaded branch from 5c7fb99 to 8915d57 Compare July 19, 2017 12:15
@mastilver
Copy link
Owner Author

mastilver commented Jul 19, 2017

@fedeoo I took your original commit from #21 , added some tests and refactored it a bit
I will fix the tests tonight.

@mastilver mastilver force-pushed the fix-multiple-version-loaded branch from 8915d57 to cd4f909 Compare July 19, 2017 12:23
@codecov-io
Copy link

codecov-io commented Jul 19, 2017

Codecov Report

Merging #25 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #25     +/-   ##
=========================================
+ Coverage   98.64%   98.75%   +0.1%     
=========================================
  Files           1        1             
  Lines          74       80      +6     
=========================================
+ Hits           73       79      +6     
  Misses          1        1
Impacted Files Coverage Δ
src/index.js 98.75% <100%> (+0.1%) ⬆️

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 ed1e72a...4ca5dc7. Read the comment docs.

src/index.js Outdated
@@ -72,6 +73,11 @@ export default class ModulesCdnWebpackPlugin {

const {version, peerDependencies} = readPkgUp({cwd: resolvePkg(modulePath, {cwd: contextPath})}).pkg;

const isAnotherVersionOfModuleLoaded = this.modulesFromCdn[modulePath] && this.modulesFromCdn[modulePath].version !== version;
if (isAnotherVersionOfModuleLoaded) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should exit early if module with the same version is already loaded

@mastilver mastilver force-pushed the fix-multiple-version-loaded branch from cd4f909 to 4ca5dc7 Compare July 19, 2017 20:35
@mastilver mastilver merged commit d3e2ea1 into master Jul 19, 2017
@mastilver mastilver deleted the fix-multiple-version-loaded branch July 19, 2017 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants