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

Css not auto-updating if required from html #57

Closed
DeMoorJasper opened this issue Dec 6, 2017 · 6 comments · Fixed by #128
Closed

Css not auto-updating if required from html #57

DeMoorJasper opened this issue Dec 6, 2017 · 6 comments · Fixed by #128

Comments

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Dec 6, 2017

🙋 feature request
Include css-loader (auto-refresh css) in the bundle if the css is declared in the html

🔦 Context
So for example if someone would use one big global css file in index.html like this, it would not auto-update

<link rel="stylesheet" href="./global.css" />
@davidnagli
Copy link
Contributor

davidnagli commented Dec 6, 2017

How is this different from #36? Didn’t you already fix this #58?

@DeMoorJasper
Copy link
Member Author

DeMoorJasper commented Dec 6, 2017

#36 was a small bug with getBundleUrl, this is something in the bundler.
This bug is about not including the css-loader.js module in the bundle unless css is being imported from js.
So for example if someone would use one big global css file in index.html like this:
<link rel="stylesheet" href="./global.css" />
It would not auto-update

@devongovett
Copy link
Member

I believe a parallel JS bundle will get created alongside the CSS, but it doesn't currently get inserted into the HTML. We should do that similar to how we do it for the opposite case (CSS imported from JS). https://github.com/parcel-bundler/parcel/blob/master/src/packagers/HTMLPackager.js#L11

@abienz
Copy link

abienz commented Jan 9, 2018

I still see this issue with Parcel 1.4.1 and css or styl files in both Firefox and Google Chrome.

Has it actually been fixed?

<html>
  <head>
    <script src="index.js"></script>
    <link href="./base.css" type="text/css" rel="stylesheet" />
  </head>

  <body>
    <h1>Hello world</h1>
    <p>Beep boop</p>
  </body>
</html>
* {
  margin: 0;
  padding: 0;
}

h1 {
  color: #F0F;
}

p {
  color: #0F0;
}

Changing the color values of the h1 and p will not trigger a reload or update of the browser, I have to hit refresh myself.

@DeMoorJasper
Copy link
Member Author

@abienz this is not yet published on npm, it’s already in the master branch however

Sent with GitHawk

@abienz
Copy link

abienz commented Jan 9, 2018

@DeMoorJasper Thanks for the info, I look forward to seeing the update.

padmaia added a commit that referenced this issue Jun 5, 2020
Fix Sentry version reporting

Approved-by: Will Binns-Smith
Approved-by: Stacy London
gorakong pushed a commit that referenced this issue May 5, 2022
Merge v2 into Atlassian 08-17-21

Approved-by: Will Binns-Smith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants