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

Live Reload when changing locals for posthtml-expressions #2317

Closed
optikfluffel opened this issue Nov 23, 2018 · 8 comments
Closed

Live Reload when changing locals for posthtml-expressions #2317

optikfluffel opened this issue Nov 23, 2018 · 8 comments
Labels
🐛 Bug CSS Preprocessing All the PostCSS, Less, SASS, etc issues

Comments

@optikfluffel
Copy link

optikfluffel commented Nov 23, 2018

❔ Question

Is there a way to tell Parcel to reload the page while developing, when one changes the locals that posthtml-expressions uses?

I tried putting parts of these locals into a js file and require them in my .posthtmlrc, but that doesn't do anything. Probably because these config files are only read once on startup.

🔦 Context

I'd like to be able to preview changes in the data posthtml-expressions uses, while running the dev server. Right now I have to restart it every time.

🌍 Your Environment

Software Version(s)
Parcel v1.10.3
Node v11.2.0
npm 6.4.1
macOS 10.14.1
@DeMoorJasper
Copy link
Member

DeMoorJasper commented Nov 30, 2018

Yes config files are read once and cached, they do get invalidated when they change.
But it does not have the ability to have dependencies that can update/invalidate the config yet.

However this should probably be added in the future as many config files contain fields like extends

@optikfluffel
Copy link
Author

they do get invalidated when they change

But that still doesn't make live reloading possible, does it?

@DeMoorJasper
Copy link
Member

It should reload if a config changes.

@optikfluffel
Copy link
Author

optikfluffel commented Dec 10, 2018

It doesn't seem to work for me. I've made a seperate branch where I've put my locals back in .posthtmlrc.js but when I change them, while running parcel, the page doesn't change.
I still have to stop and start parcel again manually.

@mattwaler
Copy link

This is still an issue as of May 23, 2018. Anybody have any idea how to fix this?

@mattwaler
Copy link

My current solution is to just use this method:

<ul class="flex">
        <each loop="item in
          [
            { name: 'facebook', link: '/' },
            { name: 'twitter', link: '/' },
            { name: 'pinterest', link: '/' },
            { name: 'envelope', link: '/' },
          ]">
          <li class="w-32 h-32 m-8">
            <a target="_blank" href="{{ item.link }}">
              <include src="{{ `assets/icons/${item.name}.svg` }}"></include>
            </a>
          </li>
        </each>
      </ul>

This way, the data is re-referenced every time I make a change.

@mischnic mischnic added 🐛 Bug CSS Preprocessing All the PostCSS, Less, SASS, etc issues and removed ❔ Question labels May 23, 2019
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Jan 18, 2020
@github-actions github-actions bot closed this as completed Feb 3, 2020
@icesurf666
Copy link

But the problem remains

@github-actions github-actions bot removed the Stale Inactive issues label Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug CSS Preprocessing All the PostCSS, Less, SASS, etc issues
Projects
None yet
Development

No branches or pull requests

5 participants