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

[pack问题]忽视<!--[if lt IE 9]>进行合并 #253

Open
glone008 opened this issue Dec 20, 2014 · 1 comment
Open

[pack问题]忽视<!--[if lt IE 9]>进行合并 #253

glone008 opened this issue Dec 20, 2014 · 1 comment

Comments

@glone008
Copy link

问题复现1:
我使用的是fis-plus
login.tpl 代码片段:

 <!--[if lt IE 9]>
        {%require name="common:static/bootstrap/assets/js/ie8-responsive-file-warning.js"%}
 <![endif]-->

fis-conf.js pack 设置片段:

'static/pkg/b.js': [
            'static/bootstrap/assets/js/ie8-responsive-file-warning.js',   ****关注******
            'static/bootstrap/assets/js/ie-emulation-modes-warning.js',
            'static/bootstrap/js/bootstrap.min.js',
            'static/bootstrap/assets/js/ie10-viewport-bug-workaround.js'
        ]

fisp release -mop 后,tpl生成的代码如下

login.tpl
******
<!--[if lt IE 9]>
<![endif]-->
***
****
</div></body><script type="text/javascript" src="/static/common/mod_96dd55b.js"></script>
<script type="text/javascript" src="/static/common/pkg/j_7e57d31.js"></script>
<script type="text/javascript" src="/static/common/pkg/b_fdda4a3.js"></script>
</html>
********

应该是被合并到static/pkg/b.js文件了。

问题复现2:
将ie8-responsive-file-warning.js从pack去掉,重新 fisp release -mop

login.tpl
******
<!--[if lt IE 9]>
<![endif]-->
***
****
</div></body><script type="text/javascript" src="/static/common/mod_96dd55b.js"></script>
<script type="text/javascript" src="/static/common/pkg/j_7e57d31.js"></script>
<script type="text/javascript" src="/static/common/bootstrap/assets/js/ie8-responsive-file-warning_24dfb55.js"></script>****关注******
<script type="text/javascript" src="/static/common/pkg/b_fdda4a3.js"></script>
</html>
********  

也就是hack ie9的js放到底部了,这应该是BUG

总结:
1.对于把hack ie9 类似的js pack合并,fis系统层面能智能识别或者有报警提示。毕竟上述问题测试不好发现
2.对于问题2,应属bug,希望改正

@hefangshi
Copy link
Member

require标签是无法和注释联合工作的,并且你这样打包以后,在IE8下到底是加载打包后的资源还是打包前的呢?

IE注释进行加载的使用场景请直接使用<script>标签,并且没有打包的意义

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