Skip to content

Commit cac9814

Browse files
[fix]elasticsearch xml-js无node环境报错 review by songym
1 parent 952cf94 commit cac9814

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

build/webpack.config.mapboxgl.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ module.exports = {
2828
'webgl-debug': '(function(){try{return webgl-debug}catch(e){return {}}})()',
2929
xlsx: 'function(){try{return XLSX}catch(e){return {}}}()',
3030
canvg: 'function(){try{return canvg}catch(e){return {}}}()',
31-
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()',
32-
'xml-js': 'function(){try{return convert}catch(e){return {}}}()'
31+
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()'
3332
}),
3433

3534
module: {

src/common/thirdparty/elasticsearch/ElasticSearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* This program are made available under the terms of the Apache License, Version 2.0
33
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
44
import {Events} from '../../commontypes/Events';
5-
import es from '@elastic/elasticsearch';
65
import {Util} from "../../commontypes/Util";
76

87
/**
@@ -60,6 +59,7 @@ export class ElasticSearch {
6059
* @member {Object} ElasticSearch.prototype.client
6160
* @description client ES客户端。
6261
*/
62+
var es = require('@elastic/elasticsearch');
6363
try {
6464
// 老版本
6565
this.client = new es.Client({

src/mapboxgl/mapping/WebMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { Lang } from '@supermap/iclient-common/lang/Lang';
1616
import { parseCondition, parseConditionFeature } from '@supermap/iclient-common/util/FilterCondition';
1717
import { Util } from '../core/Util';
1818
import { QueryService } from '../services/QueryService';
19-
import convert from 'xml-js';
19+
import convert from 'xml-js/dist/xml-js.min';
2020
import Canvg from 'canvg';
2121

2222

0 commit comments

Comments
 (0)