@nextcloud/vite-config
    Preparing search index...

    Interface LibraryOptions

    SPDX-FileCopyrightText: 2023 Ferdinand Thiessen opensource@fthiessen.de

    SPDX-License-Identifier: AGPL-3.0-or-later

    interface LibraryOptions {
        assetFileNames?: (chunkInfo: PreRenderedAsset) => string | undefined;
        config?: UserConfigExport;
        coreJS?: CoreJSPluginOptions;
        cssFileName?: string;
        DtsPluginOptions?: false | { vue?: boolean } & Options;
        inlineCSS?: boolean;
        libraryFormats?: LibraryFormats[];
        minify?: boolean;
        nodeExternalsOptions?: ExternalsOptions;
        nodePolyfills?: boolean | PolyfillOptions;
        replace?: Record<string, string>;
    }

    Hierarchy (View Summary)

    Index
    assetFileNames?: (chunkInfo: PreRenderedAsset) => string | undefined

    Customize the asset file names. Similar to output.assetFileNames in rolldown config, but if returns undefined, then this config defaults is be used.

    Move CSS styles to `styles/style.css` instead of the default `css/[entrypoint-name].css`:
    (chunkInfo) => chunkInfo.names[0].endsWith('.css') ? 'styles/style.css' : undefined
    config?: UserConfigExport

    Vite config to override or extend the base config

    coreJS?: CoreJSPluginOptions

    Enable and adjust settings for core-js polyfills

    By default disabled as Nextcloud core already includes the core-js/stable polyfills globally

    cssFileName?: string

    Filename of the css output when a single CSS file should be extracted (inlineCSS: false) Note this only works with Vite 6.

    style.css

    DtsPluginOptions?: false | { vue?: boolean } & Options

    Options for the Vite DTS plugin

    This plugin allows to create .d.ts files for your library including the .vue files. Pass false to disable the plugin and not generate any .d.ts files. If you do not use Vue in your project set { vue: false } to disable the Vue support and speed up the build. Otherwise you can also directly set any of the options of the rolldown-plugin-dts plugin.

    Type Declaration

    • false
    • { vue?: boolean } & Options
      • Optionalvue?: boolean

        If set to false no Vue types will be generated

    inlineCSS?: boolean

    Inject all styles inside the javascript bundle instead of emitting a .css file

    false
    
    libraryFormats?: LibraryFormats[]

    Formats you like your library to be built

    ['es']
    
    minify?: boolean

    Whether to minify the output

    false For libraries the code is not minified by default for better DX. Usually it is not needed: a library will be minified as a part of an app bundling.
    
    nodeExternalsOptions?: ExternalsOptions

    Options for the rollup node externals plugin

    By default all dependencies and peerDependencies are marked as external. And node builtins prefix (node:) is stripped to make the library compatible with webpack and node-polyfill-webpack-plugin.

    Note: If you use dependencies @nextcloud/vue/dist/Components/NcButton.js and what them to be externalized too, you need to set an include pattern: { include: [ /^@nextcloud/vue/ ]}

    nodePolyfills?: boolean | PolyfillOptions

    Inject polyfills for node packages

    false Disabled to reduce buildtime
    
    replace?: Record<string, string>

    Strings to replace within your code