Skip to content
Snippets Groups Projects
  • Piotr Brzeziński's avatar
    d25c58ea
    gstwebrtc-api: Add ESM build artifact, fix compatibility with module-based environments · d25c58ea
    Piotr Brzeziński authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
    This lib was only being built for direct usage as a <script>, and so it
    refused to work under any module-based approach, e.g. in a React
    project.
    
    Webpack will now build an ESM bundle alongside the old browser-only one.
    This ensures broader compatibility, and has been tested in an Angular
    project where this lib wasn't easily usable previously.
    
    As a sidenote, the 'browser' field was broken because the string is
    never interpolated. That was breaking build e.g. when trying to use our
    lib with Angular. This has been replaced with a hardcoded string under
    the 'module' field (because we don't ship separate browser/non-browser
    bundles, the 'browser' field isn't necessary).
    
    Part-of: <!2049>
    d25c58ea
    History
    gstwebrtc-api: Add ESM build artifact, fix compatibility with module-based environments
    Piotr Brzeziński authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
    This lib was only being built for direct usage as a <script>, and so it
    refused to work under any module-based approach, e.g. in a React
    project.
    
    Webpack will now build an ESM bundle alongside the old browser-only one.
    This ensures broader compatibility, and has been tested in an Angular
    project where this lib wasn't easily usable previously.
    
    As a sidenote, the 'browser' field was broken because the string is
    never interpolated. That was breaking build e.g. when trying to use our
    lib with Angular. This has been replaced with a hardcoded string under
    the 'module' field (because we don't ship separate browser/non-browser
    bundles, the 'browser' field isn't necessary).
    
    Part-of: <!2049>