Ver código fonte

build(webpack): make sure we're not bundling same deps twice

As versions of libraries that are both used by swagger-js and swagger-ui
may diverge in time, we must use webpack resolve aliases to make sure
that only one version of these libraries gets bundled.
bubble
Vladimir Gorej 4 anos atrás
pai
commit
c30760cfe5
1 arquivos alterados com 10 adições e 0 exclusões
  1. +10
    -0
      webpack/bundle.babel.js

+ 10
- 0
webpack/bundle.babel.js Ver arquivo

@@ -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')
},
},
}
)



Carregando…
Cancelar
Salvar