You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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]
The text was updated successfully, but these errors were encountered:
Both of them are @1.10.1, but since their paths are different, Webpack will bundle them separately in the bundle.
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:
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.
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
inwebchat.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/microsoft-cognitiveservices-speech-sdk@1.10.1
packages/directlinespeech/node_modules/microsoft-cognitiveservices-speech-sdk@1.10.1
Both of them are
@1.10.1
, but since their paths are different, Webpack will bundle them separately in the bundle. Everymicrosoft-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 aliasmicrosoft-cognitiveservices-speech-sdk
together. But it need to be elaborated if we are using tree-shaking, like below:Long-term solution
Since we cannot hoist packages due to technical problems, what we could do for long-term is to write a
ResolverPlugin
forWebpack
that will do dedupe based on package name and version numbers.[Enhancement]
The text was updated successfully, but these errors were encountered: