Skip to content

vite4.0 无法排除lodash依赖 #6919

@jc840031139

Description

@jc840031139
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.0.1

Environment

vue 3.3.4 、vite 4.4.9

Reproduction link

http://www.a.com

Steps to reproduce

##通过rollup-plugin-external-globals 来排除依赖

export default defineConfig({
build: {
rollupOptions: {
plugins: [externalGlobals({ lodash: "_" })],
},
},
});


<script src="https://unpkg.com/lodash@4.17.21/lodash.min.js"></script>

What is expected?

我希望lodash 能让我通过cdn引入 微前端中子应用无需打包进去

What is actually happening?

通过rollup-plugin-visualizer依赖分析lodash 还是被打包进去

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions