Skip to content

Commit 3c230c1

Browse files
[fix]elastic doc修改 review by songym
1 parent f99e931 commit 3c230c1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/common/thirdparty/elasticsearch/ElasticSearch.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ import {Util} from "../../commontypes/Util";
1818
* @param {Object} [options.geoFence] - 地理围栏。
1919
* @description
2020
* <h3 style="font-size: 20px;margin-top: 20px;margin-bottom: 10px;">11.1.0</h3>
21-
* 该功能依赖<a href="https://github.com/elastic/elasticsearch">@elastic/elasticsearch</a>, webpack.5或其他不包含Node.js Polyfills的打包工具,需要加入相关配置,以webpack为例:
22-
<pre><code>module.exports: {
21+
* 该功能依赖<a href="https://github.com/elastic/elasticsearch">@elastic/elasticsearch</a>, webpack5或其他不包含Node.js Polyfills的打包工具,需要加入相关配置,以webpack为例:<br/>
22+
<p style="margin-top:10px;">首先安装相关Polyfills</p><pre><code>npm i stream-http https-browserify stream-browserify tty-browserify browserify-zlib os-browserify buffer url assert process -D</code></pre>
23+
然后配置webpack<pre><code>module.exports: {
2324
resolve: {
25+
alias: {
26+
process: 'process/browser',
27+
},
2428
mainFields: ['browser', 'main'],
2529
fallback: {
2630
fs: false,
@@ -32,6 +36,12 @@ import {Util} from "../../commontypes/Util";
3236
zlib: require.resolve('browserify-zlib')
3337
}
3438
}
39+
plugins: [
40+
new webpack.ProvidePlugin({
41+
process: 'process/browser',
42+
Buffer: ['buffer', 'Buffer']
43+
}),
44+
]
3545
}</code></pre>
3646
* @usage
3747
*/

0 commit comments

Comments
 (0)