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

fis有办法合并js请求并替换吗 #184

Open
gaotianlin2998 opened this issue Nov 10, 2014 · 8 comments
Open

fis有办法合并js请求并替换吗 #184

gaotianlin2998 opened this issue Nov 10, 2014 · 8 comments

Comments

@gaotianlin2998
Copy link

1、我有两个html页面a.html,b.html 开发环境 a.html依赖了a.js,b.js ,h.html依赖了c.js,d.js .线上环境打包我需要把每一个页面的js合并成一个请求,如/combo?a.js&b.js b.html合并/combo?c.js&d.js .应该怎么做是否支持。
2、html是否支持md5加时间戳。 项目中html5也是走的cdn缓存

@hefangshi
Copy link
Member

关于请求合并可以参考 #182

html加上MD5戳也是支持的

配置一下roadmap.path即可

fis.config.set('roadmap.path', [
    {
        reg:'**.html',
        useHash: true
    }
]);

roadmap使用请遵循其使用原则

http://fis.baidu.com/docs/advance/roadmap.html

@gaotianlin2998
Copy link
Author

html md5后,是否页面对应超链接也能修改?

@hefangshi
Copy link
Member

@gaotianlin2998 没问题的,试试看

@gaotianlin2998
Copy link
Author

页面没有替换新的连接,是不是需要定位资源标签?

@gaotianlin2998
Copy link
Author

求解决。

@hefangshi
Copy link
Member

a标签是不会自动替换的,可以在JS中使用

var link = __uri('./a.html');

获取最新的URL

如果需要替换a标签,需要自己扩展才行

@gaotianlin2998
Copy link
Author

请求合并并不是js合并之后替换html的标签,js文件还是单独存在的。

@hefangshi
Copy link
Member

@gaotianlin2998 请求合并是会替换html标签的,你确定开启了simple插件了么?

建议试用一下快速入门

http://fis.baidu.com/docs/beginning/getting-started.html

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