close
  • 简体中文
  • Rule index

    List of the error codes
    E1001Duplicate Packages
    E1002Cross Chunks Packages
    E1003Loader Performance Optimization
    E1004ECMA Version Check
    E1005Default Import Check
    E1006Module Mixed Chunks
    E1007Tree Shaking Side Effects Only
    E1008CJS Require Cannot Tree-Shake
    E1009ESM Import Resolved to CJS
    E1001Duplicate Packages
    bundle

    Description

    There is a same name package which is bundled in multiple versions in your application.

    This negatively impacts the bundle size of your application.

    General Solution

    Add an entry in resolve.alias to configure Webpack to route any package references to a single specified path.

    For example, if lodash is duplicated in your bundle, the following configuration would make all Lodash imports refer to the lodash instance found at ./node_modules/lodash:

    {
      alias: {
        lodash: path.resolve(__dirname, 'node_modules/lodash')
      }
    }