Skip to content

Possible to have multiple entry points? #1079

Closed

Description

@riceyeh

My app has 2 entry points. Is there a way to make it?

Activity

  1. gaearon commented on Nov 21, 2016

    @gaearon
    Contributor

    Sorry, but Create React App doesn't support this use case.
    You can eject and then configure Webpack to have multiple entry points.

  2. lcoder commented on May 14, 2017

    @lcoder

    how to make multiple entry points with eject

  3. gaearon commented on May 15, 2017

    @gaearon
    Contributor

    If you eject, please follow Webpack's documentation on entry points.

  4. lcoder commented on May 16, 2017

    @lcoder

    @gaearon
    Thanks! I know how to make multiple entry points with webpack.
    something like:

    const config = {
      entry: {
        index: './src/index.js',
        detail: './src/detail.js'
      }
    };

    this code will generate two entry points:index.min.js&detail.min.js.
    But I confused about how I work with HtmlWebpackPlugin to explore the pages.
    like http://localhost:8080/index & http://localhost:8080/detail

  5. gaearon commented on May 16, 2017

    @gaearon
    Contributor

    I don’t really know either, sorry 😅
    You can try asking in the respective repos.

  6. lcoder commented on May 16, 2017

    @lcoder

    @gaearon Thank you all the same.

  7. maoshuai commented on Jun 15, 2017

    @maoshuai

    Actually, you need to config webpack entry/htmlWebpackPlugin/webpack dev server, here is a best practice:http://imshuai.com/create-react-app-multiple-entry-points/

  8. locked and limited conversation to collaborators on Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions