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

Multiple html entrys not shared css assets #1441

Closed
c0b41 opened this issue May 26, 2018 · 10 comments
Closed

Multiple html entrys not shared css assets #1441

c0b41 opened this issue May 26, 2018 · 10 comments

Comments

@c0b41
Copy link

c0b41 commented May 26, 2018

❔ Question

#1119 multiple entry support, shared javascript working, but external css not shared only index.html shared css

πŸ”¦ Context

πŸ’» Code Sample

https://github.com/c0b41/parcel-html-boilerplate

🌍 Your Environment

Software Version(s)
Parcel 1.8.1
Node 8.10.0
npm/Yarn 1.5.1
Operating System Windows 10 Home
@DeMoorJasper
Copy link
Member

Please fill in the issue template.

@c0b41
Copy link
Author

c0b41 commented May 28, 2018

@DeMoorJasper updated.

@vlados
Copy link

vlados commented Sep 21, 2018

I have the same problem? Is there any progress on this issue?

@elsheepo
Copy link

elsheepo commented Sep 22, 2018

when I bundle multiple entry points, I get my SCSS converted to CSS and bundled with bootstrap.css as expected and jquery.js/bootstrap.js/custom.js bundled on the first html file in alphabetical order, and the rest only HTML & JavaScript, it is not adding the <link href="{name}{hash}.css"> to subsequent pages.
I have tried these...
parcel *.html and parcel index.html about.html contact.html documentation.html repository.html

fyi: each page (index.html, about.html, etc) links to index.js like so...
<script src="./index.js"></script>

and the contents of index.js are...

import './vendor/bootstrap/css/bootstrap.min.css'
import './vendor/fontawesome-free/css/all.min.css'
import './scss/custom.scss'
import './vendor/jquery/jquery.min.js'
import './vendor/bootstrap/js/bootstrap.bundle.min.js'
import './js/custom.js'

So to reiterate, the first entry point (in alphabetical order, in my case it chooses about.html) gets links to both the bundled css & javascript, but the rest of the pages only get a link to the bundled javascript.

Here are the resulting about.html and index.html after having executed parcel *.html
notice how on line 16 of about.html a link is inserted into the <head> referring to the bundled css. Where as in subsequent html files, such as index.html there is not.

@lowtrux
Copy link

lowtrux commented Nov 13, 2018

Have anyone solved this problem ?, I have the same issue and I haven't been able to find a solution. Parcel will include the CSS file in the first file after the parcel command and won't do it for the subsequent files in the list so in:

  "scripts": {
    "build": "parcel home.html index.html"
  }

Parcel will only add the .css file to home.html but not to index.html. Can't believe the parcel team hasn't been able to come with a solution for such an important issue. Any help will be really appreciated.

@mischnic
Copy link
Member

Closing as duplicate of #2340

@ikennobunga
Copy link

Facing the same issue css only shows on the first index.html file and not on the following html files. Is there a solution to this?

@shasherazi
Copy link

Still not solved.

@devongovett
Copy link
Member

Do you have a reproduction?

@shasherazi
Copy link

Do you have a reproduction?

My bad. I thought this issue was related to my problem.

I shared my problem here in another issue.

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

No branches or pull requests

10 participants