For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/rspeedy/rspeedy.resolve.dedupe.md.
Rspeedy logo
Rspeedy
  • English
  • Home > @lynx-js/rspeedy > Resolve > dedupe

    Resolve.dedupe property

    Force to resolve the specified packages from project root, which is useful for deduplicating packages and reducing the bundle size.

    Signature:

    dedupe?: string[] | undefined;

    Default Value

    undefined

    Remarks

    Resolve.dedupe is implemented based on Resolve.alias, it will get the path of the specified package through require.resolve in the project root directory and set it to the alias.

    The alias generated by Resolve.dedupe will be merged with the configured Resolve.alias in the project, and the Resolve.alias config will take precedence when the keys are the same.

    Example

    Use tslib from the project root directory.

    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      resolve: {
        dedupe: ['tslib'],
      },
    })
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.