For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/build/output/filename/css.md.
Lynx
  • 简体中文
  • output.filename.css

    optional css?: Filename

    Lynx 默认值覆盖

    此项是 Rsbuild 配置,pluginLynx 覆盖了它的默认值。下方默认值指应用插件后的值。请在 rsbuild.config.ts 顶层配置,显式设置的值优先。

    完整行为见 Rsbuild 配置参考。

    CSS 文件的名称。

    默认值

    '[name]/[name].css'

    示例

    • 使用函数根据文件信息动态设置文件名:
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      output: {
        filename: {
          css: (pathData, assetInfo) => {
            console.log(pathData); // You can check the contents of pathData here
    
            if (pathData.chunk?.name === 'index') {
              return isProd ? '[name].[contenthash:8].css' : '[name].css';
            }
            return '/some-path/[name].css';
          },
        },
      },
    })
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。