Skip to content

Commit

Permalink
use babel to transpile ts codes to es5 excluding plugins causing perf…
Browse files Browse the repository at this point in the history
… issue (#2415)

* fix TileLayer.forceReload

* use babel to transpile ts codes to es5 excluding plugins causing perf issue, fix #2397
  • Loading branch information
fuzhenn authored Sep 5, 2024
1 parent 4b2a5c5 commit 0ca28ec
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ module.exports = {
"presets": [
["@babel/env", {
"loose": true,
"modules": false
"modules": false,
"exclude": [
"transform-destructuring",
"transform-spread",
"transform-parameters"
]
}]
],
"plugins": [
Expand Down
4 changes: 4 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const rollupPlugins = [
commonjs(),
typescript({
sourceMap: true
}),
babel({
extensions: [".ts"],
babelHelpers: 'bundled'
})
];

Expand Down
4 changes: 3 additions & 1 deletion src/layer/tile/TileLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ class TileLayer extends Layer {
forceReload() {
this.fire('forcereloadstart');
this.clear();
this.load();
if (this._renderer) {
this._renderer.setToRedraw();
}
this.fire('forcereloadend');
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// ask tsc not to mess up with for ... of
"downlevelIteration": true,
"module": "esnext",
"target": "es5",
"target": "es6",
"jsx": "preserve",
"lib": [
"es2015",
Expand Down

0 comments on commit 0ca28ec

Please sign in to comment.