Skip to content

Commit

Permalink
fix(webpack.config): update webpack config for webpack 5
Browse files Browse the repository at this point in the history
  • Loading branch information
apaparazzi0329 committed Jan 28, 2021
1 parent 89bda7d commit a0a69d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
10 changes: 8 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
},
};

0 comments on commit a0a69d0

Please sign in to comment.