Skip to content

Commit 0ca28ec

Browse files
authored
use babel to transpile ts codes to es5 excluding plugins causing perf issue (#2415)
* fix TileLayer.forceReload * use babel to transpile ts codes to es5 excluding plugins causing perf issue, fix #2397
1 parent 4b2a5c5 commit 0ca28ec

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

babel.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ module.exports = {
22
"presets": [
33
["@babel/env", {
44
"loose": true,
5-
"modules": false
5+
"modules": false,
6+
"exclude": [
7+
"transform-destructuring",
8+
"transform-spread",
9+
"transform-parameters"
10+
]
611
}]
712
],
813
"plugins": [

rollup.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ const rollupPlugins = [
3535
commonjs(),
3636
typescript({
3737
sourceMap: true
38+
}),
39+
babel({
40+
extensions: [".ts"],
41+
babelHelpers: 'bundled'
3842
})
3943
];
4044

src/layer/tile/TileLayer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ class TileLayer extends Layer {
257257
forceReload() {
258258
this.fire('forcereloadstart');
259259
this.clear();
260-
this.load();
260+
if (this._renderer) {
261+
this._renderer.setToRedraw();
262+
}
261263
this.fire('forcereloadend');
262264
return this;
263265
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// ask tsc not to mess up with for ... of
2020
"downlevelIteration": true,
2121
"module": "esnext",
22-
"target": "es5",
22+
"target": "es6",
2323
"jsx": "preserve",
2424
"lib": [
2525
"es2015",

0 commit comments

Comments
 (0)