Skip to content
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: support more features of DefinePlugin #7108

Merged
merged 2 commits into from
Jul 10, 2024
Merged

feat: support more features of DefinePlugin #7108

merged 2 commits into from
Jul 10, 2024

Conversation

h-a-n-a
Copy link
Collaborator

@h-a-n-a h-a-n-a commented Jul 10, 2024

Summary

Support more JavaScript values for DefinePlugin:

type CodeValue = RecursiveArrayOrRecord<CodeValuePrimitive>;
type CodeValuePrimitive =
	| null
	| undefined
	| RegExp
	| Function
	| string
	| number
	| boolean
	| bigint
	| undefined;
type RecursiveArrayOrRecord<T> =
	| { [index: string]: RecursiveArrayOrRecord<T> }
	| Array<RecursiveArrayOrRecord<T>>
	| T;
type DefineValue = Record<string, CodeValue>

Support typeof xxx as the key of DefineValue.

closes #7084

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Jul 10, 2024
Copy link

netlify bot commented Jul 10, 2024

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 706466a
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/668e7f56c69ea10008d2c575
😎 Deploy Preview https://deploy-preview-7108--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@h-a-n-a h-a-n-a marked this pull request as ready for review July 10, 2024 12:33
@h-a-n-a h-a-n-a requested a review from ahabhgk July 10, 2024 12:34
@h-a-n-a h-a-n-a enabled auto-merge (squash) July 10, 2024 12:43
@h-a-n-a h-a-n-a merged commit 584cd90 into main Jul 10, 2024
34 checks passed
@h-a-n-a h-a-n-a deleted the feat/align-define branch July 10, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support DefinePlugin typeof
2 participants