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;

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'],
  },
})
除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。