How to use the @vue/cli-ui/ui-defaults/utils/stats.processStats function in @vue/cli-ui

To help you get started, we’ve selected a few @vue/cli-ui 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 universal-vue / uvue / packages / @uvue / vue-cli-plugin-ssr / ui.js View on Github external
async function onWebpackMessage({ data: message }) {
    if (message.webpackDashboardData) {
      const modernMode = getSharedData('modern-mode').value;
      const type = message.webpackDashboardData.type;

      for (const data of message.webpackDashboardData.value) {
        const id = `${type}-${data.type}`;

        if (data.type === 'stats') {
          // Stats are read from a file
          const statsFile = path.resolve(api.getCwd(), `./node_modules/.stats-${type}.json`);
          const value = await fs.readJson(statsFile);
          const { stats, analyzer } = processStats(value);
          setSharedData(id, stats);
          setSharedData(`${id}-analyzer`, analyzer);
          await fs.remove(statsFile);
        } else if (data.type === 'progress') {
          if (type === 'serve' || !modernMode) {
            setSharedData(id, {
              [type]: data.value,
            });
          } else {
            // Display two progress bars
            const progress = getSharedData(id).value;
            progress[type] = data.value;
            for (const t of ['ssr-build', 'ssr-build-modern']) {
              setSharedData(`${t}-${data.type}`, {
                'ssr-build': progress['ssr-build'] || 0,
                'ssr-build-modern': progress['ssr-build-modern'] || 0,

@vue/cli-ui

### Local development

MIT
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages