Xd Plugin using Angular

#1

Is anybody writing plugin using angular?

#2

Try using it in XD plugin just like react is used (https://github.com/AdobeXD/plugin-samples/tree/master/quick-start-react). You might have to add a shim…

#3

I mean I’m already writing plugin with angular, just curious if i’m the only one :slight_smile:

#4

I don’t think you’re the only one trying to use Angular, but I don’t think there’s been any published in the Plugin Manager that use it … AFAIK, anyway.

What version of Angular are you using? Any tips on getting it to work?

#5

I’m trying to use Angular 7.2 (which is the latest one). Really not much tricks for now (as development is not finished yet).
I use ngx-build-plus to extend default webpack. I added webpack.extra.js with following config:
module.exports = { externals:{ scenegraph: "commonjs scenegraph", uxp: "commonjs uxp" } } for correct xd packages import.
Also I had to override PlatformLocation with empty stub to use routes without history api and window.location object.
And of course replace other required window objects with empty stubs like following:
window.HTMLMediaElement = {};
window.HTMLFrameSetElement = {};
window.HTMLBodyElement = {};
window.HTMLFrameElement = {};
These minimal configurations let me build and run plugin. Without watch and auto refresh for now but it works :slight_smile:

2 Likes