Enhance webpack configuration for optimization and language support

This commit is contained in:
Laurent Nguyen
2026-04-30 09:29:51 +02:00
parent 5bf0970b5e
commit a117c7335a
2 changed files with 37 additions and 1 deletions
+3
View File
@@ -6,6 +6,9 @@
<meta name="robots" content="noindex, nofollow" />
<title>Azure Cosmos DB</title>
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon" />
<link rel="dns-prefetch" href="https://management.azure.com" />
<link rel="dns-prefetch" href="https://login.microsoftonline.com" />
<link rel="dns-prefetch" href="https://cosmos.azure.com" />
</head>
<body>
+34 -1
View File
@@ -212,7 +212,9 @@ module.exports = function (_env = {}, argv = {}) {
new HTMLInlineCSSWebpackPlugin({
filter: (fileName) => fileName.includes("cellOutputViewer"),
}),
new MonacoWebpackPlugin(),
new MonacoWebpackPlugin({
languages: ["json", "sql", "javascript", "python", "plaintext"],
}),
new CopyWebpackPlugin({
patterns: [
{ from: "DataExplorer.nuspec" },
@@ -262,6 +264,37 @@ module.exports = function (_env = {}, argv = {}) {
extensions: [".tsx", ".ts", ".js"],
},
optimization: {
splitChunks: {
chunks: "all",
minSize: 30000,
maxInitialRequests: 10,
cacheGroups: {
fluentui: {
test: /[\\/]node_modules[\\/]@fluentui[\\/]/,
name: "vendor-fluentui",
chunks: "all",
priority: 30,
},
nteract: {
test: /[\\/]node_modules[\\/]@nteract[\\/]/,
name: "vendor-nteract",
chunks: "all",
priority: 30,
},
azure: {
test: /[\\/]node_modules[\\/]@azure[\\/]/,
name: "vendor-azure",
chunks: "all",
priority: 30,
},
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "vendor-common",
chunks: "all",
priority: 10,
},
},
},
minimize: mode === "production" ? true : false,
minimizer: [
new TerserPlugin({