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";
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 */
You can’t perform that action at this time.
0 commit comments