Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

ReactDOM 15.3 does not work with single module plugin #23

Closed
jasonLaster opened this issue Dec 21, 2016 · 4 comments
Closed

ReactDOM 15.3 does not work with single module plugin #23

jasonLaster opened this issue Dec 21, 2016 · 4 comments

Comments

@jasonLaster
Copy link
Contributor

react-dom has an index.js file with just a module.exports = require('react/lib/reactDOM), which our single-module-plugin turns into module.exports = require() and fails to load react dom.

@juliandescottes
Copy link
Member

Does this mean SMP confuses the index.js from react-dom with another similar file ?
I see two options here:

  • ignore small files (kind of random but should work here)
  • improve the plugin to run in several steps:
    • a: mark all the purely duplicated files (without touching require statements)
    • b: if a require() points to a duplicate marked in step a, normalize it to always point to the same ID
    • c: repeat until no more duplicates are marked

@jasonLaster
Copy link
Contributor Author

jasonLaster commented Jan 10, 2017

original:

'use strict';

module.exports = require('react/lib/ReactDOM');

webpack:

'use strict';

module.exports = require(153);

@clarkbw
Copy link
Contributor

clarkbw commented Feb 17, 2017

With SMP gone, is this still an issue?

@juliandescottes
Copy link
Member

No, moreover we're already using react & react-dom 15.3 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants