diff --git a/webpack/bundle.babel.js b/webpack/bundle.babel.js index 97925857..55e97730 100644 --- a/webpack/bundle.babel.js +++ b/webpack/bundle.babel.js @@ -2,6 +2,8 @@ * @prettier */ +import path from "path" + import configBuilder from "./_config-builder" const result = configBuilder( @@ -22,6 +24,14 @@ const result = configBuilder( output: { library: "SwaggerUIBundle", }, + resolve: { + // these aliases make sure that we don't bundle same libraries twice + // when the versions of these libraries diverge between swagger-js and swagger-ui + alias: { + "@babel/runtime-corejs2": path.resolve(__dirname, '..', 'node_modules/@babel/runtime-corejs2'), + "js-yaml": path.resolve(__dirname, '..', 'node_modules/js-yaml') + }, + }, } )