-
Notifications
You must be signed in to change notification settings - Fork 367
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
feat(module-tools): support autoExtension and shims to improve node esm mode #4831
Merged
Conversation
This file contains 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
🦋 Changeset detectedLatest commit: 2cb3d02 The changes in this PR will be included in the next version bump. This PR includes changesets to release 265 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
chenjiahan
reviewed
Oct 24, 2023
chenjiahan
reviewed
Oct 24, 2023
10Derozan
commented
Oct 24, 2023
packages/solutions/module-tools/src/builder/feature/redirect.ts
Outdated
Show resolved
Hide resolved
10Derozan
commented
Oct 24, 2023
packages/solutions/module-tools/src/builder/feature/redirect.ts
Outdated
Show resolved
Hide resolved
chenjiahan
previously approved these changes
Oct 24, 2023
10Derozan
force-pushed
the
feat/autoExtension
branch
from
October 24, 2023 10:56
2236933
to
9c0ffed
Compare
10Derozan
force-pushed
the
feat/autoExtension
branch
from
October 25, 2023 06:58
02244eb
to
2cb3d02
Compare
chenjiahan
approved these changes
Oct 25, 2023
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
🤖 Generated by Copilot at 35b3016
This pull request adds support for different output file extensions for JavaScript and TypeScript modules based on the module type and format. It also adds some features and options for building bundles with esbuild, such as injecting global variables and shims for compatibility. It updates the build config schema, types, utils and dts modules to reflect the new features and options. It also adds some tests and changesets for the new features.
Details
🤖 Generated by Copilot at 35b3016
.changeset/orange-garlics-beg.md
file to describe the changes in the pull request (link)getDefaultOutExtension
function toutils/outExtension.ts
file to determine the default output file extension based on the format, root and autoExtension options (link)shims
andautoExtension
properties to the build config schema, types, constants and merge functions, and set their default values (link, link, link, link, link, link, link, link)dtsExtension
property to theGeneratorDtsConfig
interface and thegeneratorDts
function, and use it to set the output file extension for the declaration files (link, link, link, link, link, link)jsExtension
property to theredirect
andredirectImport
functions, and use it to modify the import name based on the module type and format (link, link, link, link)inject
andoutExtension
properties to the esbuild build options, and use them to inject global variables and shims and customize the output file extension for the JavaScript bundles (link)writeDtsFiles
function to write the declaration files directly to the output directory with the correct file extension (link)shims/cjs.js
andshims/esm.js
files to define and export global variables and shims for the CommonJS and ES modules bundles (link, link)getDefaultOutExtension
function in thebuild
,redirect
andesbuild
modules, and use it to get thejsExtension
anddtsExtension
values based on the build config options (link, link, link, link, link, link, link)path
module in theesbuild
andredirect
modules, and use it to manipulate file paths and get file extensions (link, link)autoExtension
feature with thetype-commonjs
project type, and use theimport
function and thepath
module to test the dynamic import and the output file extension (link, link, link, link, link)Related Issue
Checklist
pnpm run change
.