Skip to content

fix(extension-sdk): use posix path to support windows build#2404

Merged
JammingBen merged 1 commit intoopencloud-eu:mainfrom
Cassolette:patch/sdk-windows
Apr 28, 2026
Merged

fix(extension-sdk): use posix path to support windows build#2404
JammingBen merged 1 commit intoopencloud-eu:mainfrom
Cassolette:patch/sdk-windows

Conversation

@Cassolette
Copy link
Copy Markdown
Contributor

Description

Extensions built using the sdk on Windows will not work out of the box. This is because the entrypoint path is being exported with non-POSIX compliant file separators.

{
  "entrypoint": "js\\remoteEntry-Cx_RoXqY.mjs"
}

Export posix‑compatible paths to Vite to fix issues on Windows.

Related Issue

  • Fixes <issue_link>

How Has This Been Tested?

  • Manual: checked correct entrypoint path in manifest.json build output
{
  "entrypoint": "js/remoteEntry-Cx_RoXqY.mjs"
}

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Extensions built using the sdk on Windows will not work out of the box.
This is because the entrypoint path is being exported with non-POSIX
compliant file separators.

Export posix‑compatible paths to Vite to fix issues on Windows.
@Cassolette
Copy link
Copy Markdown
Contributor Author

Ref:

vite/packages/vite/src/node/build.ts

      entryFileNames: ssr
        ? `[name].${jsExt}`
        : libOptions
          ? ({ name }) =>
              resolveLibFilename(
                libOptions,
                format,
                name,
                root,
                jsExt,
                packageCache,
              )
          : path.posix.join(options.assetsDir, `[name]-[hash].${jsExt}`),
      chunkFileNames: libOptions
        ? `[name]-[hash].${jsExt}`
        : path.posix.join(options.assetsDir, `[name]-[hash].${jsExt}`),

@@ -88,8 +88,11 @@ export function defineConfig(overrides: ExtensionConfigOverrides = {}) {
[name]: './src/index.ts'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we're already hardcoding path separators it might be worth it to just stick to that 🙂

Copy link
Copy Markdown
Member

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@JammingBen JammingBen merged commit 27d3e7a into opencloud-eu:main Apr 28, 2026
28 checks passed
@openclouders openclouders mentioned this pull request Apr 28, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants