chore: refactor extensions build script for optimization #4363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This PR aims to refactor all the extensions bundlers. We've replaced webpack and rollup with rolldown, which is incredibly fast and already supports built-in plugins. This change will significantly reduce development and CI build times.
Reduced 1m / os / job
Fixes Issues
Self Checklist
This pull request includes several changes aimed at migrating the build system from Webpack and Rollup to Rolldown across multiple extensions. Additionally, it introduces some environment variable handling and updates TypeScript configurations. Here are the most important changes:
Build System Migration:
extensions/assistant-extension/package.json
: Replaced Webpack and Rollup with Rolldown for the build process and added new dependencies for Rolldown. [1] [2]extensions/assistant-extension/rolldown.config.mjs
: Added new Rolldown configuration file to replace Rollup configuration.extensions/assistant-extension/rollup.config.ts
: Removed the old Rollup configuration file.extensions/conversational-extension/package.json
: Replaced Webpack with Rolldown for the build process and added new dependencies for Rolldown. [1] [2]extensions/conversational-extension/rolldown.config.mjs
: Added new Rolldown configuration file.extensions/conversational-extension/webpack.config.js
: Removed the old Webpack configuration file.extensions/engine-management-extension/package.json
: Replaced Webpack with Rolldown and updated dependencies.extensions/engine-management-extension/rolldown.config.mjs
: Updated to use Rolldown and removed unnecessary plugin. [1] [2] [3]extensions/inference-anthropic-extension/package.json
: Replaced Webpack with Rolldown and updated dependencies.extensions/inference-anthropic-extension/rolldown.config.mjs
: Added new Rolldown configuration file.extensions/inference-anthropic-extension/webpack.config.js
: Removed the old Webpack configuration file.extensions/inference-cohere-extension/package.json
: Replaced Webpack with Rolldown and updated dependencies. [1] [2]extensions/inference-cohere-extension/rolldown.config.mjs
: Added new Rolldown configuration file.extensions/inference-cohere-extension/webpack.config.js
: Removed the old Webpack configuration file.extensions/inference-cortex-extension/package.json
: Replaced Rollup with Rolldown for the build process.Environment Variable Handling:
.github/workflows/jan-electron-linter-and-test.yml
: Added a step to set theIS_TEST
environment variable.extensions/assistant-extension/package.json
: Modified thebuild-universal-hnswlib
script to skip the universal build ifIS_TEST
is set to true.TypeScript Configuration Updates:
extensions/assistant-extension/tsconfig.json
: Updated TypeScript configuration to change module and target settings, and adjusted strictness.Code Cleanup:
extensions/assistant-extension/src/node/index.ts
: Removed unused import.extensions/inference-anthropic-extension/src/index.ts
: Removed unused declared constants.extensions/inference-cohere-extension/src/index.ts
: Removed unused declared constants.