From a0a69d002f08344caa1a4ede8d6cbfb2796cf1e5 Mon Sep 17 00:00:00 2001 From: Angelo Paparazzi Date: Thu, 28 Jan 2021 12:51:10 -0500 Subject: [PATCH] fix(webpack.config): update webpack config for webpack 5 --- package.json | 3 ++- webpack.config.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ce472d39..5ee55b96 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "autofix": "eslint . --fix", "test": "npm run lint && npm run test-offline", "test-offline": "karma start --single-run", - "test-integration": "TEST_MODE=integration karma start --single-run", + "test-integration": "TEXT_TO_SPEECH_URL=https://api.us-south.text-to-speech.watson.cloud.ibm.com TEXT_TO_SPEECH_IAM_APIKEY=OldPvSWgwIMXs_FcCkDc-MqX3cUiZgC1gop0yYTPipnk SPEECH_TO_TEXT_URL=https://api.us-south.speech-to-text.watson.cloud.ibm.com SPEECH_TO_TEXT_IAM_APIKEY=mpb-9dsWS0xYvMN2KhooxfnHZB7Lrz67ki6EUD2YS3rc TEST_MODE=integration karma start --single-run", "webpack": "webpack", "browserify": "browserify index.js -t [ babelify --presets [ @babel/preset-env ] ] -t [ envify ] --standalone WatsonSpeech --outfile dist/watson-speech.js", "minify": "uglifyjs --source-map --compress --mangle --output dist/watson-speech.min.js --beautify \"beautify=false,preamble='// IBM Watson Speech JavaScript SDK\\n// $npm_package_version\\n// Generated at `date`\\n// Copyright IBM ($npm_package_license)\\n// $npm_package_homepage'\" dist/watson-speech.js", @@ -65,6 +65,7 @@ "prettier": "^2.2.1", "serve-static": "^1.14.1", "sinon": "^9.2.4", + "stream-browserify": "^3.0.0", "transform-loader": "^0.2.4", "uglify-js": "^3.12.5", "watchify": "^3.11.1", diff --git a/webpack.config.js b/webpack.config.js index 5c4ebc5f..32295e3c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -18,10 +18,16 @@ module.exports = { }, { test: /index.js$/, - loader: 'transform-loader?envify', - // options: {...} + use: { + loader: 'transform-loader?envify', + } }, ], }, mode: 'development', + resolve: { + fallback: { + "stream": require.resolve("stream-browserify") + } + }, };