Skip to content

Commit a0a69d0

Browse files
fix(webpack.config): update webpack config for webpack 5
1 parent 89bda7d commit a0a69d0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"autofix": "eslint . --fix",
1313
"test": "npm run lint && npm run test-offline",
1414
"test-offline": "karma start --single-run",
15-
"test-integration": "TEST_MODE=integration karma start --single-run",
15+
"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",
1616
"webpack": "webpack",
1717
"browserify": "browserify index.js -t [ babelify --presets [ @babel/preset-env ] ] -t [ envify ] --standalone WatsonSpeech --outfile dist/watson-speech.js",
1818
"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 @@
6565
"prettier": "^2.2.1",
6666
"serve-static": "^1.14.1",
6767
"sinon": "^9.2.4",
68+
"stream-browserify": "^3.0.0",
6869
"transform-loader": "^0.2.4",
6970
"uglify-js": "^3.12.5",
7071
"watchify": "^3.11.1",

webpack.config.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ module.exports = {
1818
},
1919
{
2020
test: /index.js$/,
21-
loader: 'transform-loader?envify',
22-
// options: {...}
21+
use: {
22+
loader: 'transform-loader?envify',
23+
}
2324
},
2425
],
2526
},
2627
mode: 'development',
28+
resolve: {
29+
fallback: {
30+
"stream": require.resolve("stream-browserify")
31+
}
32+
},
2733
};

0 commit comments

Comments
 (0)