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

standalone 模式支持多个 script 同时引入 #10

Closed
sorrycc opened this issue Nov 19, 2014 · 4 comments
Closed

standalone 模式支持多个 script 同时引入 #10

sorrycc opened this issue Nov 19, 2014 · 4 comments
Assignees

Comments

@sorrycc
Copy link
Member

sorrycc commented Nov 19, 2014

场景:

  1. standalone 打包
  2. 复杂项目,有多个页面,比如 index.html, list.html
  3. 出于性能考虑,提取了 common.js,同时被多个页面引入

页面调用:

<script src="common.js"></script>
<script src="index.js"></script>

问题:

  1. 载入了多个 seajs 实例,可优化成一个
  2. 执行顺序问题。由于每个 script 在调试模式下都是用 seajs.use 引入的,无法保证顺序
@afc163
Copy link
Member

afc163 commented Nov 19, 2014

感觉搞复杂了。这种场景用 seajs.use 好了。

@sorrycc sorrycc self-assigned this Nov 19, 2014
@sorrycc
Copy link
Member Author

sorrycc commented Nov 19, 2014

无线端不想用 seajs 啊

@afc163
Copy link
Member

afc163 commented Nov 19, 2014

umd 的打包方式呢?

@sorrycc
Copy link
Member Author

sorrycc commented Nov 19, 2014

这个场景的公用部分还包含业务代码的。如果公用部分是一个独立的包,是可以用 umd + ignore 的组合的。

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