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

Possible to have multiple entry points? #1079

Closed
riceyeh opened this issue Nov 21, 2016 · 7 comments
Closed

Possible to have multiple entry points? #1079

riceyeh opened this issue Nov 21, 2016 · 7 comments

Comments

@riceyeh
Copy link

riceyeh commented Nov 21, 2016

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

@gaearon
Copy link
Contributor

gaearon commented Nov 21, 2016

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

@lcoder
Copy link

lcoder commented May 14, 2017

how to make multiple entry points with eject

@gaearon
Copy link
Contributor

gaearon commented May 15, 2017

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

@lcoder
Copy link

lcoder commented May 16, 2017

@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

@gaearon
Copy link
Contributor

gaearon commented May 16, 2017

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

@lcoder
Copy link

lcoder commented May 16, 2017

@gaearon Thank you all the same.

@maoshuai
Copy link

maoshuai commented Jun 15, 2017

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/

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
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

4 participants