Skip to content

Commit

Permalink
[fix]elasticsearch xml-js无node环境报错 review by songym
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiao-supermap committed Aug 21, 2023
1 parent 952cf94 commit cac9814
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions build/webpack.config.mapboxgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ module.exports = {
'webgl-debug': '(function(){try{return webgl-debug}catch(e){return {}}})()',
xlsx: 'function(){try{return XLSX}catch(e){return {}}}()',
canvg: 'function(){try{return canvg}catch(e){return {}}}()',
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()',
'xml-js': 'function(){try{return convert}catch(e){return {}}}()'
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()'
}),

module: {
Expand Down
2 changes: 1 addition & 1 deletion src/common/thirdparty/elasticsearch/ElasticSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
import {Events} from '../../commontypes/Events';
import es from '@elastic/elasticsearch';
import {Util} from "../../commontypes/Util";

/**
Expand Down Expand Up @@ -60,6 +59,7 @@ export class ElasticSearch {
* @member {Object} ElasticSearch.prototype.client
* @description client ES客户端。
*/
var es = require('@elastic/elasticsearch');
try {
// 老版本
this.client = new es.Client({
Expand Down
2 changes: 1 addition & 1 deletion src/mapboxgl/mapping/WebMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Lang } from '@supermap/iclient-common/lang/Lang';
import { parseCondition, parseConditionFeature } from '@supermap/iclient-common/util/FilterCondition';
import { Util } from '../core/Util';
import { QueryService } from '../services/QueryService';
import convert from 'xml-js';
import convert from 'xml-js/dist/xml-js.min';
import Canvg from 'canvg';


Expand Down

0 comments on commit cac9814

Please sign in to comment.