Skip to content

Commit d33bfe8

Browse files
author
zhaoqin
committed
feat:替换l7-render.js => l7-render.mjs
1 parent d1242af commit d33bfe8

11 files changed

Lines changed: 77 additions & 50 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@
1111
.npmrc
1212
/dist/mapboxgl/resources/
1313
/dist/maplibregl/resources/
14-
/custom-dist/
14+
/custom-dist/
15+
/src/maplibregl/dist/
16+
/src/maplibregl/resources/

‎build/jsdocs/maplibregl/docs.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"src/common/mapping/WebMapV2Base",
7373
"src/common/mapping/WebMapService",
7474
"src/maplibregl/core/Util",
75-
"src/maplibregl/overlay/L7/l7-render"
75+
"src/maplibregl/overlay/L7/l7-render.mjs"
7676
]
7777
},
7878
"plugins": ["plugins/markdown", "../plugins/usage", "../plugins/moduleCategories","../plugins/modulecondition"],

‎build/webpack.config.maplibregl-esm.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const optionalVarExternals = Object.assign({}, configBase.externals, {
2626
xlsx: 'function(){try{return XLSX}catch(e){return {}}}()',
2727
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()',
2828
'xml-js': 'function(){try{return convert}catch(e){return {}}}()',
29-
'./L7/l7-render': 'function(){try{return L7}catch(e){return {}}}()',
29+
'./L7/l7-render.mjs': 'function(){try{return L7}catch(e){return {}}}()',
3030
'@antv/g2': 'function(){try{return G2}catch(e){return {}}}()'
3131
});
3232

‎build/webpack.config.maplibregl.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = {
3434
xlsx: 'function(){try{return XLSX}catch(e){return {}}}()',
3535
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()',
3636
'xml-js': 'function(){try{return convert}catch(e){return {}}}()',
37-
'./L7/l7-render': 'function(){try{return L7}catch(e){return {}}}()',
37+
'./L7/l7-render.mjs': 'function(){try{return L7}catch(e){return {}}}()',
3838
'@antv/g2': 'function(){try{return G2}catch(e){return {}}}()'
3939
}),
4040

‎sonar-project.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sonar.projectVersion=12.2.0
66
# Comma-separated paths to directories with sources (required)
77
sonar.sources=src/
88
sonar.inclusions=src/**/*.js
9-
sonar.exclusions=src/**/index.js,src/classic/libs/**/*.js,src/classic/resource/**/*.js,src/classic/theme/**/*.js,src/**/namespace.js,src/mapboxgl/overlay/L7/l7-render.js,src/maplibregl/overlay/L7/l7-render.js,src/common/util/UGCWasmAll.js,src/common/style/CartoCSS.js,src/leaflet/overlay/carto/*.js,src/leaflet/overlay/TiledVectorLayer.js,src/leaflet/overlay/vectortile/*.js,src/leaflet/mapping/WebMap.js,src/common/thirdparty/ai/*.js
9+
sonar.exclusions=src/**/index.js,src/classic/libs/**/*.js,src/classic/resource/**/*.js,src/classic/theme/**/*.js,src/**/namespace.js,src/mapboxgl/overlay/L7/l7-render.js,src/common/util/UGCWasmAll.js,src/common/style/CartoCSS.js,src/leaflet/overlay/carto/*.js,src/leaflet/overlay/TiledVectorLayer.js,src/leaflet/overlay/vectortile/*.js,src/leaflet/mapping/WebMap.js,src/common/thirdparty/ai/*.js
1010
# sonar.test.inclusions=test/**/*.js
1111

1212
# Language

‎src/maplibregl/overlay/L7/l7-render.js‎

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎src/maplibregl/overlay/L7/l7-render.mjs‎

Lines changed: 56 additions & 0 deletions
Large diffs are not rendered by default.

‎src/maplibregl/overlay/L7Layer.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import '../core/Base';
22
import { L7LayerBase } from '@supermapgis/iclient-common/overlay/l7/L7LayerBase';
3-
import * as L7 from './L7/l7-render';
4-
import { Scene, Maplibre } from './L7/l7-render';
3+
import * as L7 from './L7/l7-render.mjs';
4+
import { Scene, Maplibre } from './L7/l7-render.mjs';
55
import { getL7Scene } from '@supermapgis/iclient-common/overlay/l7/util';
66
import * as maplibregl from 'maplibre-gl';
77
import { getL7Filter } from '@supermapgis/iclient-common/mapping/utils/L7LayerUtil';

‎src/maplibregl/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"module": "index.js",
1111
"exports": {
1212
".": {
13-
"import": "./dist/iclient-maplibregl.mjs",
14-
"module": "./dist/iclient-maplibregl.mjs",
13+
"import": "./index.js",
14+
"module": "./index.js",
1515
"default": "./index.js"
1616
},
1717
"./dist/*": "./dist/*",

‎test/karma.conf.js‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ module.exports = function (config) {
6060
presets: ['@babel/preset-env'],
6161
plugins: [importMetaToEmptyObject]
6262
});
63+
// L7 为 ESM 包(l7-render.mjs),同样只做 ESM→CJS 与 import.meta.url 替换,不计入覆盖率
64+
const l7Mjs = require.resolve('../src/maplibregl/overlay/L7/l7-render.mjs');
65+
bundle.transform(require('babelify'), {
66+
global: true,
67+
only: [l7Mjs],
68+
presets: ['@babel/preset-env'],
69+
plugins: [importMetaToEmptyObject]
70+
});
6371
},
6472
transform: [
6573
[
@@ -78,7 +86,7 @@ module.exports = function (config) {
7886
'../node_modules/lodash/**',
7987
'../node_modules/echarts/dist/echarts.js',
8088
'../src/mapboxgl/overlay/L7/l7-render.js',
81-
'../src/maplibregl/overlay/L7/l7-render.js',
89+
'../src/maplibregl/overlay/L7/l7-render.mjs',
8290
'../node_modules/video.js/dist/video.cjs.js',
8391
'../src/common/util/UGCWasmAll.js'
8492

0 commit comments

Comments
 (0)