-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
WebPack minimize breaks widget. #172
Comments
Does the widget show up in development mode? When you initialize Annotorious, can you try adding the following property to the widget? var anno = Annotorious.init(viewer, {
widgets: [
{ widget: MyWidget, force: 'plainjs' },
'COMMENT',
'TAG'
]
}); |
Adding In any case, thanks for your help, I'm sure many others will come across this question if they search for the right thing. The issue can be closed. |
It's a work in progress... ;-) Docs are definitely coming. But there might be changes before this is fully stable. Stone background: there's some simple logic built into Annotorious that tests if a widget is vanilla JS or React. The test isn't very reliable, and seems to fail in particular for minified Vue projects. The That being said: non-React widgets will start to show performance problems once they reach a certain complexity. As I said: there's probably a bigger change on the horizon for the non-React plugin API. Can't yet say when it will happen though. |
I'm using annotorious-openseadragon (v. 2.5.7) in a simple Vue (v. 3.2.20) project and I'm having issues with my annotation widgets not displaying correctly when minification is enabled in WebPack.
To spare you the details, I have a block of code in the widget function that adds some buttons to a div container, just like in the tutorial:
The problem is that, when building the application with default settings, which include minification, I can see in the console output that the code is called, and that the element's
outerHtml
looks correct, but it simply doesn't show up in the DOM. When addingto the webpack configuration in
vue.config.js
, the code is obviously way larger, but it works correctly.What could be causing this issue? I'm trying to figure out which version of webpack the
vue cli
(v. 4.5.14) is using, but I haven't been able to find any concrete information. I've tried adding the TerserPlugin like in this example, but to no avail.The text was updated successfully, but these errors were encountered: