File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/common/thirdparty/elasticsearch Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,13 @@ import {Util} from "../../commontypes/Util";
18
18
* @param {Object } [options.geoFence] - 地理围栏。
19
19
* @description
20
20
* <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: {
23
24
resolve: {
25
+ alias: {
26
+ process: 'process/browser',
27
+ },
24
28
mainFields: ['browser', 'main'],
25
29
fallback: {
26
30
fs: false,
@@ -32,6 +36,12 @@ import {Util} from "../../commontypes/Util";
32
36
zlib: require.resolve('browserify-zlib')
33
37
}
34
38
}
39
+ plugins: [
40
+ new webpack.ProvidePlugin({
41
+ process: 'process/browser',
42
+ Buffer: ['buffer', 'Buffer']
43
+ }),
44
+ ]
35
45
}</code></pre>
36
46
* @usage
37
47
*/
You can’t perform that action at this time.
0 commit comments