Skip to content

Update getpublicpath.mdx #3806

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

Merged
merged 1 commit into from
May 30, 2025
Merged

Conversation

SuAutumn
Copy link
Contributor

@SuAutumn SuAutumn commented May 30, 2025

Using getPublicPath with Webpack Module Federation Plugin

Description

A tip for getPublicPath config in webpack plugin

module.exports = {
  entry: "./src/index.js",
  output: {
    publicPath: "auto", // or auto
  },
  plugins: [
    new ModuleFederationPlugin({
     // ...
      getPublicPath: `function abc() { __webpack_public_path__ = "https://" + window.cdn }`,
    }),
  ],
};

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Using getPublicPath with Webpack Module Federation Plugin
Copy link

changeset-bot bot commented May 30, 2025

⚠️ No Changeset found

Latest commit: 1621dff

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

Copy link

netlify bot commented May 30, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 1621dff
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/683917d3e0affb000850d37f
😎 Deploy Preview https://deploy-preview-3806--module-federation-docs.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 project configuration.

@ScriptedAlchemy ScriptedAlchemy merged commit a753735 into module-federation:main May 30, 2025
8 checks passed
@2heal1 2heal1 mentioned this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants