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

Serve multiple entries during development (or even production) #1136

Closed
khanetor opened this issue Apr 5, 2018 · 1 comment
Closed

Serve multiple entries during development (or even production) #1136

khanetor opened this issue Apr 5, 2018 · 1 comment

Comments

@khanetor
Copy link

khanetor commented Apr 5, 2018

Choose one: is this a 🐛 bug report or 🙋 feature request?

  • 🙋 feature request

We have an option to serve one entry with parcel index.js or parcel index.html. However, I am building a traditional multi-page web application, and each page has a different entry javascript. Therefore using html as the main entry is not an option. Serving multiple entries would ease development (although I think we can already do this by watching multiple files, there might be performance issue though, since there are close to 100 entries for my project).

🎛 Configuration (.babelrc, package.json, cli command)

🤔 Expected Behavior

Parcel should be able to serve multiple entries. For example, parcel file1.js file2.js should make visible http://localhost:1234/file1.js and http://localhost:1234/file2.js.

😯 Current Behavior

For now, Parcel can only serve 1 main entry. The difference would be that multiple main entries are visible as described above. We want the main entries so they do not have any hash, and another web framework can pick up the files.

💁 Possible Solution

Support multiple entries in:

  • CLI parcel entry1.js entry2.js entry3.html ...
  • List of entries in JSON. Create json file entries.json with an array of entries filenames. Then run command parcel --entries entries.json

🔦 Context

This issue is preventing me from using Parcel with a multi-page web app, where I have different html pages (from some html template engine, so I cannot use Parcel to parse the templates). With only ONE main entry being serve, I can only use 1 page at a time. When page navigation comes into play, this becomes an issue.

The context is described above: traditional multipage, with multiple javascript entries (or other asset types).

💻 Code Sample

🌍 Your Environment

Software Version(s)
Parcel 1.7.0
Node 9.10.1
npm/Yarn 5.6.0
Operating System OSX
@Hammster
Copy link
Contributor

Hammster commented Apr 5, 2018

PR #1119 should add this feature ;)

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

No branches or pull requests

3 participants