Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mountModule加载微模块时runtime是否可支持import导入的三方库 #678

Open
gdnwr opened this issue Apr 24, 2023 · 3 comments
Open

Comments

@gdnwr
Copy link

gdnwr commented Apr 24, 2023

问题:mountModule加载微模块时runtime是否可支持import导入的三方库
期望的类似效果
import axios from 'axios';
import { mountModule, unmoutModule } from '@ice/stark-module';

const moduleInfo = {
name: 'moduleName',
url: 'https://localhost/module.js',
runtime: [ { id: 'axios', url: axios } ],
};

mountModule(moduleInfo, mountNode);

@ClarkXia
Copy link
Collaborator

runtime 中的依赖 目前是需要搭配 external 的方式引入的,即引入的 url 为 umd 资源链接,同时在构建工程上需要配置 externals

@gdnwr
Copy link
Author

gdnwr commented Apr 24, 2023

@ClarkXia 您好,如果runtime可以支持import导入的三方库,这样可以把三方库都在放在主项目中,微模块共享主项目的三方库,保持微模块打包后的最小体积
不知道后续开发计划是否可以支持?

@ClarkXia
Copy link
Collaborator

ClarkXia commented May 6, 2023

现在 external 的方式 就能达到这个效果

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants