sorry, I have very little experience with js/ts but I've noticed that if I'm trying to use classes in extendscript babel adds bunch of hepers
for example like those:
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
when babel transpiles classes to functions it injects these helpers
the problem is that extendscript doesn't know anything about Object.defineProperty so as soon as I'm trying to use classes in extendscript it just breaks the bundle.
I've managed to disable helpers in vite.es.config.ts via
plugins: [
"@babel/plugin-syntax-dynamic-import",
["@babel/plugin-transform-classes", { loose: true }],
"@babel/plugin-proposal-class-properties",
]
Though I'm not sure if it's the right way
sorry, I have very little experience with js/ts but I've noticed that if I'm trying to use classes in extendscript babel adds bunch of hepers
for example like those:
when babel transpiles classes to functions it injects these helpers
the problem is that extendscript doesn't know anything about
Object.definePropertyso as soon as I'm trying to use classes in extendscript it just breaks the bundle.I've managed to disable helpers in
vite.es.config.tsviaThough I'm not sure if it's the right way