Skip to content

动态导入组件,打包时,包变的超级大 #2727

@xuejiaomeng

Description

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

Version

1.6.4

Environment

vue 2.5.17 ,Chrome浏览器, mac

Reproduction link

https://webpack.js.org/api/module-methods/#import

Steps to reproduce

在添加路由前处理,
const componentPath ='/views/dashboard/Workplace'
data['component'] =()=>import(@${componentPath})
组件动态导入成功了,但是打包的时候由原来的3M变成了44M
image

What is expected?

打包后还是3M,在路由上能动态加载组件

What is actually happening?

组件动态导入成功了,但是打包的时候由原来的3M变成了44M

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions