Feature #4655


Standard-ESM imports

Added by Michael Kay almost 4 years ago. Updated over 2 years ago.

Start date:
Due date:
% Done:


Estimated time:
Applies to JS Branch:
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Contact person:
Additional contact persons:


Request received from Max Fechner by email:

Thank you for developing saxonJS!

It would be great if you could support standard-esm imports like

import saxonJS from ''

this would work in *deno as well as nodejs as well as modern browsers!

thank you for considering this proposal!

best, Max Fechner

Actions #1

Updated by Debbie Lockett over 3 years ago

  • Applies to JS Branch 2 added
Actions #2

Updated by Norm Tovey-Walsh over 3 years ago

  • Priority changed from Normal to Low

We rely on the Closure compiler to build the release artifacts. As far as I can tell in a couple of days of research, the Closure compiler doesn't offer any options for producing ESM modules and I couldn't find any workarounds that seemed practical. I'll plan to check back periodically, and naturally I'm open to suggestions, but short of support from the compiler, I'm not sure this is something we can do.

Actions #3

Updated by Norm Tovey-Walsh about 3 years ago

  • Status changed from New to AwaitingInfo

Using "AwaitingInfo" to indicate that we need support from the Closure compiler (or something else) for this.

Actions #4

Updated by Daniel Naab about 3 years ago


Not being familiar with Saxon-JS project structure, I don't know if this is a useful suggestion or not, but typically a project would be refactored to internally use ES modules; then a tool like Rollup could be used to create the distributable artifacts (Rollup, for instance, has a Google Closure plugin - Rollup can produce a single ESM with obsfucated code, in addition to something like the current IIFE bundle.

If internally Saxon-JS is difficult to convert to ES modules, Rollup also has plugins to use alternate modules types as input. For instance, using AMD modules -

I have some familiarity with doing this, and could help clarify your options, if there is any interest. I am exploring a use case that would benefit from ESM usage, also.

Actions #5

Updated by Alf Eaton over 2 years ago

One option would be to use Skypack:

import saxonJS from '';
Actions #6

Updated by Norm Tovey-Walsh over 2 years ago

Thank you for the suggestion. I'll take a look.

Please register to edit this issue

Also available in: Atom PDF Tracking page