Sketch Assistants are cross-platform, working in both Sketch and Node.js environments. Assistants based on the Sketch Assistant Template work cross-platform already.
Following is a detailed overview on each environment’s capabilities, limitations and build requirements.
It does however have the following important limitations:
- No browser APIs
- Native Node.js modules are not available
- Module systems such as CommonJS and ESM are unsupported
These limitations have the following knock-on effects to consider while developing cross-platform Assistants:
- Since there’s no module system Assistants need to be bundled for Sketch, in our template repository we currently do this with Webpack. When Sketch loads an Assistant package it looks for the bundle at the
sketchproperty in package.json (analogous to how Node loads packages via the
main property in package.json.