Skip to content

Commit

Permalink
fix package size issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lokesh-couchbase committed May 16, 2024
1 parent cd7afc1 commit f9cbf72
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ vsc-extension-quickstart.md
node_modules/
.github/
Makefile
webpack.config.json
webpack.config.json
.git/**
/cmake*/
**/cb-vscode-extension*/
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-couchbase",
"displayName": "Couchbase",
"description": "",
"version": "2.0.1",
"version": "2.0.2",
"engines": {
"vscode": "^1.63.1"
},
Expand Down Expand Up @@ -83,6 +83,7 @@
"sass": "^1.72.0",
"sass-loader": "^14.1.1",
"style-loader": "^3.3.4",
"terser-webpack-plugin": "^5.3.10",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"typescript": "^5.4.3",
Expand Down
12 changes: 6 additions & 6 deletions src/handlers/handleCLIDownloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class DependenciesDownloader {
map.set(
this.TOOL_IMPORT_EXPORT,
this.getToolSpec(
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-macos_x86_64.zip",
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-macos_x86_64.zip",
this.TOOL_IMPORT_EXPORT,
OSUtil.MACOS_64
)
Expand Down Expand Up @@ -125,7 +125,7 @@ class DependenciesDownloader {
map.set(
this.TOOL_IMPORT_EXPORT,
this.getToolSpec(
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-macos_arm64.zip",
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-macos_arm64.zip",
this.TOOL_IMPORT_EXPORT,
OSUtil.MACOS_ARM
)
Expand Down Expand Up @@ -158,7 +158,7 @@ class DependenciesDownloader {
map.set(
this.TOOL_IMPORT_EXPORT,
this.getToolSpec(
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-windows_amd64.zip",
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-windows_amd64.zip",
this.TOOL_IMPORT_EXPORT,
OSUtil.WINDOWS_64
)
Expand Down Expand Up @@ -191,7 +191,7 @@ class DependenciesDownloader {
map.set(
this.TOOL_IMPORT_EXPORT,
this.getToolSpec(
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-windows_amd64.zip",
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-windows_amd64.zip",
this.TOOL_IMPORT_EXPORT,
OSUtil.WINDOWS_ARM
)
Expand Down Expand Up @@ -224,7 +224,7 @@ class DependenciesDownloader {
map.set(
this.TOOL_IMPORT_EXPORT,
this.getToolSpec(
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-linux_x86_64.tar.gz",
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-linux_x86_64.tar.gz",
this.TOOL_IMPORT_EXPORT,
OSUtil.LINUX_64
)
Expand Down Expand Up @@ -257,7 +257,7 @@ class DependenciesDownloader {
map.set(
this.TOOL_IMPORT_EXPORT,
this.getToolSpec(
"https://packages.couchbase.com/releases/7.2.0/couchbase-server-tools_7.2.0-linux_aarch64.tar.gz",
"https://packages.couchbase.com/releases/7.6.0/couchbase-server-tools_7.6.0-linux_aarch64.tar.gz",
this.TOOL_IMPORT_EXPORT,
OSUtil.LINUX_ARM
)
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/versionConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export const config = {
TOOLS_VERSION: "7.2",
CBMIGRATE_VERSION: "1",
SHELL_VERSION: "1",
CBIMPORT_EXPORT_VERSION: "7.2",
CBIMPORT_EXPORT_VERSION: "7.6",
};
26 changes: 23 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"use strict";

const path = require("path");
const TerserPlugin = require('terser-webpack-plugin');


/**@type {import('webpack').Configuration}*/
const extensionConfig = {
Expand All @@ -27,13 +29,19 @@ const extensionConfig = {
entry: {
"extension": "./src/extension.ts"
}, // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/

output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
libraryTarget: "commonjs2",
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
splitChunks: {
chunks: 'all',
},
},
devtool: "source-map",
externals: {
vscode: "commonjs vscode", // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
Expand Down Expand Up @@ -75,6 +83,13 @@ const reactConfig = {
path: path.resolve(__dirname, "dist/workbench"),
filename: "[name].js",
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
splitChunks: {
chunks: 'all',
},
},
devtool: "source-map",
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
Expand Down Expand Up @@ -131,7 +146,6 @@ const reactConfig = {
},
],
},
plugins: [],
};

const iqReactConfig = {
Expand All @@ -143,6 +157,13 @@ const iqReactConfig = {
path: path.resolve(__dirname, "dist/iq"),
filename: "[name].js",
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
splitChunks: {
chunks: 'all',
},
},
devtool: "source-map",
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
Expand Down Expand Up @@ -203,7 +224,6 @@ const iqReactConfig = {
},
],
},
plugins: [],
};

module.exports = [extensionConfig, reactConfig, iqReactConfig];

0 comments on commit f9cbf72

Please sign in to comment.