Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

qiankun 公共依赖库怎么提取

如果有一个主应用,4 个子用,都是基于 Vue 来开发的,那么每个应用最起码都要安装 Vue 全家桶,冗余太严重了。目前是想提取公共依赖,只在主应用中安装全家桶。


QQ20200519-105039@2x.png
官方的文档是在子应用中把公共依赖配置成 external

目前我的配置是这样写的,并不成功。

// 子应用下的 vue.config.js

module.exports = {
  configureWebpack: {
    externals: {
      vue: 'Vue'
    }
  },
};

还有就是文档中说的『不要共享运行时,即便所有的团队都是用同一个框架』,是不建议提取 Vue 全家桶成公共依赖吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...