-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Initial bundling work + bundle dictionary package #1977
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on the dev server as well as the CMS. It definitely loads fewer files. Makes sense that is still has a number of files since much of it is lazy-loaded.
When I create a new dictionary item, I get an error in console, but I'm not sure if that is related:
Lastly, it seems all repository files are loaded, even before I'm clicking on the associated actions. For example, the dictionary-export.repository-CACHE123.js
file always seems to load up front. When I then click on the "Export" action, even more files load such as the modal element and the icons in separate requests, which I guess is ok (and icons are probably not bundled anyway). Do we need to load repository class files up front?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for confirming, @madsrasmussen. Having Vite bundle it up is really helpful to see what might be lazy-loaded and what isn't. With that said, this LGTM.
Description
This is the beginning of bundling our modules. Unfortunately, bundling all the modules before v15 might not be possible because some files are located incorrectly. These files can't be moved without a breaking change. Therefore, We will go through the modules one by one, and bundle the possible ones.
This PR sets up the basic build script for bundling. The build is made with npm workspaces which makes it possible to run a "local" build script in each package. The bundling is done by Vite.
We now have one for the npm package, which is not bundled, and one for the CMS which will be partly bundled.
The idea is to build the same way as before but swap out the "old" module files for the bundled ones when a module is ready.
How to test
npm run build:for:cms
script in the CMS project.src/packages/dictionary
folder.Types of changes