About the problem that vue code is included in the package when the vue component yarn build

imitates element ui to write a component
used in the code

import Vue from "vue"

I configured him as yarn add vue in package.json-- peer

"peerDependencies": {
    "vue": "^2.5.21"
  }

but after using yarn build, I found that the generated code still includes vue code, resulting in a large package
my goal is to not want the vue code to be packaged together.
Please point out what caused it. Thank you

.
Mar.29,2022

you can package vue as a third-party module separately, using webpack.DllPlugin

Menu