与 firebase 托管和聚合物一起使用的最佳预设构建选项是什么 1.x

What are the best preset build option for use with firebase-hosting and polymer 1.x

在Polymer CLI中,目前有3个预设的构建选项,分别是es5-bundledes6-bundledes6-unbundled.

我想知道在网络传输和与不同移动浏览器的兼容性方面,与 PWA 的 firebase 托管(Polymer 1.x)一起使用的最佳预设版本是什么。

根据 documentation from Polymer:

Static hosting services like GitHub Pages and Firebase Hosting don't support serving different files to different user agents. If you're hosting your application on one of these services, you'll need to serve a single build.

If you're serving a single build to all browsers and you need to support browsers that don't support ES6, such as IE11 and Safari 9, then this build needs to be compiled to ES5:

polymer build --js-compile

如果您有 Safari 或 IE 用户,那么最佳构建预设选项将是 es5-bundled。捆绑是因为并非所有浏览器都支持 HTTP/2 推送。

es5 捆绑:

name: es5-bundled
js: {minify: true, compile: true}
css: {minify: true}
html: {minify: true}
bundle: true
addServiceWorker: true
addPushManifest: true
insertPrefetchLinks: true