build(webpack): move resolve alises to one common place

As resolving applies to everything and not just specific builds
the resolve.aliases have been moved to one common place.
This commit is contained in:
Vladimir Gorej
2020-06-30 15:28:12 +02:00
parent 3cef227368
commit 4f2e8ad7d1
2 changed files with 6 additions and 8 deletions

View File

@@ -115,6 +115,12 @@ export default function buildConfig(
resolve: {
modules: [path.join(projectBasePath, "./src"), "node_modules"],
extensions: [".web.js", ".js", ".jsx", ".json", ".less"],
// 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')
},
},
// If we're mangling, size is a concern -- so use trace-only sourcemaps

View File

@@ -24,14 +24,6 @@ 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')
},
},
}
)