tools.cssExtract

    • Type:
    type CSSExtractOptions = {
      pluginOptions?: Rspack.CssExtractRspackPluginOptions;
      loaderOptions?: Rspack.CssExtractRspackLoaderOptions;
    };
    • Default:
    const defaultOptions = {
      // The loader options
      loaderOptions: {},
      // The plugin options
      pluginOptions: {
        // The default value of cssPath is `static/css`
        // while the default value of cssFilename is `[name].[contenthash:8].css`
        filename: `${cssPath}/${cssFilename}`,
        chunkFilename: `${cssPath}/async/${cssFilename}`,
        ignoreOrder: true,
      },
    };

    The config of CssExtractRspackPlugin / mini-css-extract-plugin can be modified through tools.cssExtract.

    INFO

    The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to Rsbuild - tools.cssExtract.