In my main JS file I have something like this:
var SomeClass = require('./some-class');
export var handler = function() {
const instance = new SomeClass();
instance.hello();
}
some-class.js:
export default class SomeClass { // also tried module.exports = class SomeClass
hello() {
console.log('Hello');
}
}
But I get Object is not a constructor
in Sketch. If I replace require with import SomeClass from './some-class'
it works. Is there anyway to use require for both Sketch and user modules?