Normalize the output folders to lib-commonjs, lib-dts, and lib-esm for all projects in this repo.#5628
Merged
iclanton merged 43 commits intomicrosoft:mainfrom Feb 18, 2026
Merged
Conversation
…ugins to support ESM and CommonJS modules - Updated main entry points to use lib-commonjs and lib-esm for better module resolution. - Added exports field to package.json for improved compatibility with module systems. - Adjusted mainEntryPointFilePath in api-extractor.json to point to lib-dts for type definitions. - Enhanced typesVersions to support lib-dts for type definitions across various plugins.
…rush plugins to support ESM and CommonJS modules
- Consolidate "typings" to "types" for consistency - Add leading "./" to "main", "types", and "module" paths - Remove incorrect "main", "module", and "." exports from projects that don't have index entrypoints Co-Authored-By: Claude <noreply@anthropic.com>
…rush plugins to support ESM and CommonJS modules
…rush plugins to support ESM and CommonJS modules
…rush plugins to support ESM and CommonJS modules
…rush plugins to support ESM and CommonJS modules
…rush plugins to support ESM and CommonJS modules
10739e8 to
8a10b9e
Compare
Set "sideEffects" field in package.json across all published packages to enable webpack tree-shaking optimizations: - Pure libraries: "sideEffects": false - Executable apps with start entrypoints: sideEffects array listing lib-commonjs/ and lib-esm/ start files - eslint-patch: sideEffects array listing side-effectful entry points - webpack4-module-minifier-plugin: updated stale sideEffects path
…ma files - Expose ./heft-plugin.json in all heft plugin packages (17 projects) - Expose ./rush-plugin-manifest.json in all rush plugin packages (8 projects) - Expose ./lib/*.schema.json in all packages with schema files (28 projects) - Schema export placed before ./lib/* for correct Node.js pattern matching
…rush plugins to support ESM and CommonJS modules
…rush plugins to support ESM and CommonJS modules
…rush plugins to support ESM and CommonJS modules
d289663 to
8dfe62d
Compare
dmichon-msft
approved these changes
Feb 18, 2026
Contributor
dmichon-msft
left a comment
There was a problem hiding this comment.
Couple things caught earlier, otherwise looks good.
…ltiple rush plugins to support ESM and CommonJS modules
…ltiple rush plugins to support ESM and CommonJS modules
|
Regression: #5644 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Standardize package output folder naming across all Rush Stack packages to a consistent convention:
lib-commonjs/— CommonJS JavaScriptlib-esm/— ESM JavaScriptlib-dts/— TypeScript declarationsPreviously, many packages used
lib/as a catch-all output folder. This change moves to explicit, descriptively-named folders while maintaining backward compatibility: imports tolib/still resolve correctly via theexportsandtypesVersionsfields inpackage.json.Details
Package metadata updates (~65 published packages):
exportsfield with conditionalimport/require/typesmappingstypesVersionsto redirectlib/*tolib-dts/*for older TypeScript versionsmain,module, andtypesfields to point to new output locationsapi-extractor.jsonmainEntryPointFilePathto referencelib-dts/orlib-commonjs/as appropriateRig configuration updates (local-node-rig, local-web-rig):
tsconfig-base.json: SetoutDiranddeclarationDirto the new folder namesconfig/typescript.json: AddedadditionalModuleKindsToEmitfor dual CJS/ESM outputSpecial handling for rush-lib and rush-sdk:
lib-intermediate-commonjs,lib-intermediate-esm) that are processed by API Extractor before producing the finallib-commonjs/outputlib-esm/— only CommonJS and declarations are publishedBuild test and tutorial fixes:
lib-esm/orlib-commonjs/entry pointsscriptPathreferences fromlib/tolib-commonjs/heft-plugin.jsonentry points fromlib/tolib-commonjs/lib/tolib-esm/cssOutputFoldersto targetlib-esm/instead oflib/run-scenarios-helpersto uselib-dts/for declaration entry pointsadditionalModuleKindsToEmit: []overrides for eslint/localization test projects that setmodule: "esnext"(to avoid duplicate module kind conflicts with the rig)exportsfor theeslint-bulk-suppressionssubdirectory entry pointClean-up:
lib/and new output folders tocleanFilesinheft.jsonconfigs so that developers' machines are cleaned of stale output from before this change.prettierignoreto includelib-esm/Backward compatibility: Existing deep imports to
<package>/lib/<module>continue to work via theexportswildcard mapping./lib/*, which redirects to the appropriate output folder. ThetypesVersionsfield provides the same mapping for older TypeScript versions that don't supportexports.How it was tested
Ran
rush buildacross all 187 projects and verified all pass (excluding transient Windows filesystem lock errors unrelated to this change). Test suite execution pending final verification.Impacted documentation