rackt-cli icon indicating copy to clipboard operation
rackt-cli copied to clipboard

React dependency renaming to CamelCase fail for my project

Open tlenclos opened this issue 9 years ago • 1 comments

Hi and thanks for your amazing work on rackt libraries ! I was wondering why you rename the dependency here on your webpack config https://github.com/mzabriskie/rackt-cli/blob/master/webpack.build.js#L27

externals: {
  'react': 'React',
  'react/addons': 'React',
  'react-dom': 'ReactDOM'
}

in my project we require react with the standard name react so for example this other lib of ract fail to find React at runtime... https://github.com/rackt/react-autocomplete/blob/master/dist/react-autocomplete.js#L5.

I'm forced to create a proxy module which is ugly: define('React', ['react'], react => react)

Thanks, Thibault.

tlenclos avatar Nov 10 '15 09:11 tlenclos

I'm having the exact same issue. Because of it:

  • React is loaded twice into my bundle
  • On some systems (CI env that I don't control, case-sensitive file system maybe?), the build fails with a Cannot find module 'React' from [...] error.

I'm using Browserify to bundle my project, which may not process package names as Webpack does.

thibaudcolas avatar Jan 14 '16 17:01 thibaudcolas