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: add support for output.crossOriginLoading config #2632

Merged
merged 11 commits into from
Apr 6, 2023

Conversation

chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Apr 6, 2023

Summary

Add support for output.crossOriginLoading config, same as webpack:crossOriginLoading.

Document: web-infra-dev/rspack-website#255

anonymous

module.exports = {
  output: {
    crossOriginLoading: "anonymous"
  }
};

use-credentials

module.exports = {
  output: {
    crossOriginLoading: "use-credentials"
  }
};

Related issue (if exists)

Types of changes

  • Docs change / Dependency upgrade
  • Bug fix
  • New feature / Improvement
  • Refactoring
  • Breaking change

Checklist

  • I have added changeset via pnpm run changeset.
  • I have added tests to cover my changes.

@changeset-bot
Copy link

changeset-bot bot commented Apr 6, 2023

⚠️ No Changeset found

Latest commit: 0974b9f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Apr 6, 2023
@chenjiahan chenjiahan added this to the modern.js milestone Apr 6, 2023
@hyf0 hyf0 modified the milestones: modern.js, Next minor release Apr 6, 2023
@hyf0 hyf0 modified the milestone: Next minor release Apr 6, 2023
underfin
underfin previously approved these changes Apr 6, 2023
@underfin
Copy link
Collaborator

underfin commented Apr 6, 2023

Webpack has test/configCases/crossorigin/set-crossorigin test, if add it will be better.

@chenjiahan
Copy link
Member Author

Webpack has test/configCases/crossorigin/set-crossorigin test, if add it will be better.

I have tried to enable that case, but it seems like some runtime methods is not implemented yet, such as __non_webpack_require__.

Maybe we can enable it after __non_webpack_require__ is added.

image

@chenjiahan chenjiahan added this pull request to the merge queue Apr 6, 2023
Merged via the queue into main with commit d007971 Apr 6, 2023
7 checks passed
@chenjiahan chenjiahan deleted the feat/cross_origin_loading branch April 6, 2023 06:27
#[serde(rename_all = "camelCase")]
#[napi(object)]
pub struct RawCrossOriginLoading {
#[napi(ts_type = "boolean | string")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typing here seems differentiated from the usage "bool" | "string"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: output.crossOriginLoading support
4 participants