Commit f2d50edc authored by Robert Knight's avatar Robert Knight

Update Babel compilation targets

Update Babel compilation targets to match the browsers we currently support,
rather than transpiling everything down to ES5.

This reduces the size of our JS bundles and improves performance by using native
implementations of ES2015+ language features. It should also avoid
occassional issues in development caused by interactions of Babel plugins that
compile native features to older syntax (eg. `transform-async-to-promises`).

The client's boot script has a different configuration than the rest of the
client because it needs to be able to run in older browsers in order to show a
warning when the browser is not supported.

The production bundle size changes resulting from this are:

Sidebar bundle: 398 KB => 329 KB
Annotator bundle: 219 KB => 169 KB
parent 8dd7a112
...@@ -4,14 +4,17 @@ ...@@ -4,14 +4,17 @@
"pragma": "createElement" "pragma": "createElement"
}], }],
["@babel/preset-env", { ["@babel/preset-env", {
"bugfixes": true,
"targets": { "targets": {
"browsers": ["> 0.3%"] "chrome": "55",
"edge": "17",
"firefox": "53",
"safari": "10.1",
} }
}] }]
], ],
"plugins": [ "plugins": [
"angularjs-annotate", "angularjs-annotate"
"transform-async-to-promises"
], ],
"ignore": ["**/vendor/*"], "ignore": ["**/vendor/*"],
"env": { "env": {
......
{
"presets": [
["@babel/preset-env", {
"targets": {
"chrome": "40",
"firefox": "38",
"safari": "9",
"ie": "11"
}
}]
],
"plugins": [
"transform-async-to-promises"
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment