How to use @pattern-lab/live-server - 3 common examples

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}`);
        }
      });
    },
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}`);
        }
      });
    },
github pattern-lab / patternlab-node / packages / core / src / lib / server.js View on Github external
setTimeout(() => {
            try {
              liveServer.start(liveServerConfig);
              resolveMsg = `Pattern Lab is being served from http://127.0.0.1:${liveServerConfig.port}`;
              logger.info(resolveMsg);
            } catch (e) {
              const err = `Pattern Lab serve failed to start: ${e}`;
              logger.error(`Pattern Lab serve failed to start: ${e}`);
              reject(err);
            }
            setupEventWatchers();
            serverReady = true;
            resolve(resolveMsg);
          }, liveServerConfig.wait);
        });

@pattern-lab/live-server

simple development http server with live reload capability

MIT
Latest version published 4 months ago

Package Health Score

71 / 100
Full package analysis