improve browser compatibility
- babel:
-
targets.esmodules: target all browsers supporting es modules. -
debug: list targeted browsers and applied transforms.
-
- polyfills:
- I've tried to use
usebuiltinsbut that addimportsto core-js node dependencies and doesn't work in browser. Can we fix that? - Use core-js as cdn (45.34 Ko) es6 polyfills.
- Use dom4 as cdn (5.54 Ko) dom polyfills.
- I also disable transform-async-to-generator because it break cypress test (I don't know why). this concerns
{ "ios":"10.3", "safari":"10.1" }. - I disable transform-template-literals because template literal used in widgets will not be transform. Basic browser support seems ok.
- We also need to polyfill
customElements, it is not posible toimportthe polyfill because in this case it apply aftercustomElements.define()use. dev must add the<script>in html.
- I've tried to use
targeted browsers:
{
"android": "61",
"chrome": "61",
"edge": "16",
"firefox": "60",
"ios": "10.3",
"opera": "48",
"safari": "10.1",
"samsung": "8.2"
}
Edited by Clément