Closed KonghaYao closed 1 month ago
This pull request refactors the build system to use Vite, updates asset management for browser and node environments, and removes obsolete configuration files. Key changes include updating import paths, renaming plugins, and adding new utility scripts.
Files | Changes |
---|---|
packages/subsets/src/adapter/AssetsMap.ts packages/subsets/src/adapter/assets.ts packages/subsets/src/adapter/browser/browserPresets.ts packages/subsets/src/adapter/node/nodeAssets.json |
Refactored asset management to use browser and node presets. |
packages/subsets/index.html packages/subsets/test/deno.onlne.test.js packages/subsets/test/deno.test.js |
Updated import paths and path transformations for fontSplit and Assets. |
packages/vite/rspack.config.js packages/vite/src/unplugin.ts packages/vite/vite.config.mts |
Refactored Vite and Rspack configurations, including plugin renaming and new Vite config files. |
packages/subsets/src/useSubset/calcContoursBorder.ts packages/subsets/src/convert/convert.manager.ts packages/subsets/src/env.d.ts |
Fixed and updated various utility functions and configurations. |
packages/subsets/test/checkResultHash.mjs script/fix_vite_lib_assets.mjs |
Added new utility scripts for hash checking and Vite asset fixing. |
packages/subsets/rollup.config.browser.mjs packages/subsets/vitest.config.ts packages/subsets/rollup.config.js packages/subsets/scripts/common.config.mjs packages/vite/tsup.config.ts |
Removed obsolete configuration files. |
Summary by Sourcery
Refactor build configuration to use Vite, update import paths and module declarations, and add scripts for build and test enhancements.
Enhancements:
AssetsMap
to include conditional compilation for browser environments.loadHarbuzz
method fromSystemAssetsMap
class.index.html
and test files to usecn-font-split.browser.js
.unplugin
withfontPlugin
inrspack.config.js
andunplugin.ts
.calcContoursBorder
to use a more accurate calculation forContoursPerByte
.ConvertManager
to useworkerURL.toString()
for worker pool initialization.env.d.ts
.Build:
vite.config.mts
forsubsets
,metrics
, andvite
packages with specific build configurations.NodeNativePolyfill
script for handling node module replacements in browser environments.fix_vite_lib_assets.mjs
script to modify Vite build behavior.Tests:
checkResultHash.mjs
script to verify hash consistency of.woff2
files across different environments.Chores:
rollup.config.browser.mjs
,vitest.config.ts
,rollup.config.js
,common.config.mjs
, andtsup.config.ts
.