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

Vite and AMD #266

Open
maasha opened this issue Oct 23, 2023 · 4 comments
Open

Vite and AMD #266

maasha opened this issue Oct 23, 2023 · 4 comments

Comments

@maasha
Copy link

maasha commented Oct 23, 2023

Hello there,

In an unrelated project I have issues using vite with the azure-devops-extension-sdk library which uses AMD that vite does not handle out of the box. I do notice that you in this project apparently have resolved this problem. Could you please briefly explain your setup?

Cheers,

Martin

@woehrl01
Copy link
Owner

@maasha

I don't recall exactly, but I think I solved it by converting the sdk to not use AMD: https://github.com/woehrl01/azdo-workitem-documents-extension/blob/main/patches/azure-devops-extension-sdk%2B2.0.11.patch

@maasha
Copy link
Author

maasha commented Oct 23, 2023

@woehrl01 ah, I see. And I suppose creating the patch is not trivial?

There is a fork of the SDK explaining that converting from AMD to ESM requires a lot of fixing:

https://www.npmjs.com/package/azure-devops-extension-sdk-esm?activeTab=readme

also, I doubt that this package is production ready.

Moreover, there is no ESM version of the azure-devops-extension-api also required for creating DevOps extensions :o(

Cheers,

Martin

@woehrl01
Copy link
Owner

woehrl01 commented Oct 23, 2023

If I remember correctly, I just downloaded the sdk and changed from AMD to commonjs and used the resulting js as patch in this extension. This worked fine. @maasha

@maasha
Copy link
Author

maasha commented Oct 24, 2023

@woehrl01 Thanks. I still think it would be neat if there was a vite plugin for AMD ala rollup-plugin-amd (which I fail to make work).

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

No branches or pull requests

2 participants