storybookjs/storybook

[Bug]: `@storybook/vue3-vite` does not set `build.chunkSizeWarningLimit` or have a default.

Open

#24865 opened on Nov 16, 2023

View on GitHub
 (3 comments) (0 reactions) (0 assignees)TypeScript (89,909 stars) (10,058 forks)batch import
bugbuilder-vitehas workaroundhelp wanted

Description

Describe the bug

@storybook/vue3-vite does not set build.chunkSizeWarningLimit or have a default.

  • storybook-static has a build chunk (js file) that is 700kb at minimum.
  • Default warning limit is 500kb for a single chunk.
  • Suggest 800kb.

Are pull requests welcome for this ?

To Reproduce

Build default vite / vue project to reproduce.

System

any

Additional context

Temp fix :

  async viteFinal(config) {
    return mergeConfig(config, {
      build: {
        chunkSizeWarningLimit: 800
      }
    });
  }

Temp fix full example :

// .storybook/main.js

import { mergeConfig } from 'vite';

/** @type { import('@storybook/vue3-vite').StorybookConfig } */
const config = {
  stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
  addons: ['@storybook/addon-essentials'],
  framework: {
    name: '@storybook/vue3-vite',
    options: {}
  },
  async viteFinal(config) {
    return mergeConfig(config, {
      build: {
        chunkSizeWarningLimit: 800
      }
    });
  }
};

export default config;

Contributor guide