Is it possible to utilize ES6 imports within XD plugins?
When attempting to use import Vue from 'vue'
, the build task is successful, but XD throws an error in the developer console during plugin loading:
Plugin Error: Error loading plugin <settings>/develop/my_plugin
Plugin TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
at Module.<anonymous> (<settings>/develop/my_plugin/main.js:14367:16)
...
I initially started with the Hello Vue Dialog example found here, which was then converted to a Panel. The same error persists even when using the dialog example instead. There were no alterations made to the package.json and webpack.config.js files, so the libraryTarget
remains as commonjs2
. Do I require an additional plugin to resolve ES6 module imports?
In another thread, Adobe XD's support for ES6 Imports and Exports is not explicitly mentioned: Can you use ES2015+ features (ES6) in Adobe XD plugins?
Since my code base heavily relies on ES6 modules, I would like to seamlessly integrate it into the plugin without having to replace every import
statement with require
.
If necessary, I can provide a minimal example.
Thank you for your assistance.
Best regards, Daniel