GithubHelp home page GithubHelp logo

Comments (7)

isaachinman avatar isaachinman commented on July 24, 2024 1

Okay, I will begin converting my projects to webpack and let you know if I have any peer dep issues. Cheers.

from react-lite.

Lucifier129 avatar Lucifier129 commented on July 24, 2024

Suggest using webpack.

from react-lite.

ChieveiT avatar ChieveiT commented on July 24, 2024

It seems an issue of npm. Using webpack alias can help require supports alias in building but npm still install react instead of react-lite if the package has a peer dep of react. Most of time both react and react-lite will be installed in your project. Maybe you still need to work with react in development as react-lite's README suggests? BTW, I don't think npm is friendly enough to project developers, npm hopes everything is a package, which always confuses me.

from react-lite.

isaachinman avatar isaachinman commented on July 24, 2024

@Lucifier129 Is this webpack configuration (as per the README) enough to override peer deps? If so feel free to close this.

// webpack.config.js
{
  resolve: {
    alias: {
      'react': 'react-lite',
      'react-dom': 'react-lite'
    }
  }
}

from react-lite.

Lucifier129 avatar Lucifier129 commented on July 24, 2024

@isaachinman It will not override any deps in any package.json, just replaces react with react-lite for optimizing the script size when bundling.

from react-lite.

isaachinman avatar isaachinman commented on July 24, 2024

Yes, but in theory browserify does this too. It is the peer deps that cause React to be bundled instead of react-lite.

I'm asking if you can confirm that this problem doesn't happen with webpack, because you suggested using it over browserify.

from react-lite.

Lucifier129 avatar Lucifier129 commented on July 24, 2024

@isaachinman Yes, I think using webpack will not hit the problem that you described above.

from react-lite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.