How to use the @pattern-lab/live-server.refreshCSS function in @pattern-lab/live-server

To help you get started, we’ve selected a few @pattern-lab/live-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pattern-lab / patternlab-node / packages / core / src / lib / server.js View on Github external
return new Promise((resolve, reject) => {
        let action;
        try {
          if (!patternlab.isBusy) {
            if (_data.file.indexOf('css') > -1 || _data.action === 'refresh') {
              action = 'refreshed CSS';
              liveServer.refreshCSS();
            } else {
              action = 'reloaded';
              liveServer.reload();
            }
            resolve(`Server ${action} successfully`);
          }
        } catch (e) {
          reject(`Server reload or refresh failed: ${e}`);
        }
      });
    },

@pattern-lab/live-server

simple development http server with live reload capability

MIT
Latest version published 11 months ago

Package Health Score

61 / 100
Full package analysis