Feature Request
Background
As microsoft-cognitiveservices-speech-sdk has stable release for Direct Line Speech, we should converge all versions used in Web Chat to a single one, reducing out footprint.
Marked are 3 copies of microsoft-cognitiveservices-speech-sdk in webchat.js.

Update on 2020-03-26
Despite converging, Webpack doesn't dedupe packages based on their name + version.
For example, we have:
Both of them are @1.10.1, but since their paths are different, Webpack will bundle them separately in the bundle. Every microsoft-cognitiveservices-speech-sdk will take up about 250-300 KB after minified before gzip.
Short-term solution
What we could do temporarily is to use resolve.alias to alias microsoft-cognitiveservices-speech-sdk together. But it need to be elaborated if we are using tree-shaking, like below:
resolve: {
alias: {
+ 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/AudioConfig': resolve(__dirname, 'node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/AudioConfig.js'),
+ 'microsoft-cognitiveservices-speech-sdk/distrib/lib/microsoft.cognitiveservices.speech.sdk': resolve(__dirname, 'node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/microsoft.cognitiveservices.speech.sdk.js'),
+ 'microsoft-cognitiveservices-speech-sdk': resolve(__dirname, 'node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/microsoft.cognitiveservices.speech.sdk.js'),
react: resolve(__dirname, 'node_modules/isomorphic-react/dist/react.js'),
'react-dom': resolve(__dirname, 'node_modules/isomorphic-react-dom/dist/react-dom.js')
},
Long-term solution
Since we cannot hoist packages due to technical problems, what we could do for long-term is to write a ResolverPlugin for Webpack that will do dedupe based on package name and version numbers.
[Enhancement]
Feature Request
Background
As
microsoft-cognitiveservices-speech-sdkhas stable release for Direct Line Speech, we should converge all versions used in Web Chat to a single one, reducing out footprint.Marked are 3 copies of
microsoft-cognitiveservices-speech-sdkinwebchat.js.Update on 2020-03-26
Despite converging, Webpack doesn't dedupe packages based on their name + version.
For example, we have:
packages/bundle/node_modules/[email protected]packages/directlinespeech/node_modules/[email protected]Both of them are
@1.10.1, but since their paths are different, Webpack will bundle them separately in the bundle. Everymicrosoft-cognitiveservices-speech-sdkwill take up about 250-300 KB after minified before gzip.Short-term solution
What we could do temporarily is to use
resolve.aliasto aliasmicrosoft-cognitiveservices-speech-sdktogether. But it need to be elaborated if we are using tree-shaking, like below:resolve: { alias: { + 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/AudioConfig': resolve(__dirname, 'node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/AudioConfig.js'), + 'microsoft-cognitiveservices-speech-sdk/distrib/lib/microsoft.cognitiveservices.speech.sdk': resolve(__dirname, 'node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/microsoft.cognitiveservices.speech.sdk.js'), + 'microsoft-cognitiveservices-speech-sdk': resolve(__dirname, 'node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/microsoft.cognitiveservices.speech.sdk.js'), react: resolve(__dirname, 'node_modules/isomorphic-react/dist/react.js'), 'react-dom': resolve(__dirname, 'node_modules/isomorphic-react-dom/dist/react-dom.js') },Long-term solution
Since we cannot hoist packages due to technical problems, what we could do for long-term is to write a
ResolverPluginforWebpackthat will do dedupe based on package name and version numbers.[Enhancement]