Skip to content

Css File changes not causing the browser to automatically reload #1064

Closed
@MelzerC

Description

@MelzerC

I am using Pattern Lab Node v3.0.3 on Mac, with Node v12.10.0, using a Vanilla Edition.

Expected Behavior

Whenever I edit one of my css files I would expect the browser to reload because of the file change (since I explicitly have to configure the path to the css files in the config).

Actual Behavior

Instead nothing happens and I have to manually reload the Browser page to see the changes made in css files.

Steps to Reproduce

Setup a pattern-lab starterkit version (I'm using the one with handlebars) containing some demo patterns and try changing the css files.

To work around I manually fixed those by changing the file:
@pattern-lab/core/src/lib/server.js:57 to add the following code:

patternlab.events.on(events.PATTERNLAB_PATTERN_ASSET_CHANGE, () => {
    if (serverReady) {
        _module.reload({
            file: '',
            action: 'reload',
        });
    }
});

This actually works, but as soon as I update the package my changes are gone. Did I miss anything and there is a better way to reload the browser automatically whenever I change css files?

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions