Closed SomethingSexy closed 2 years ago
I might have opened this ticket too soon. I switched the default provider to jspm.system
and that seems to give me a version without the export being added.
@SomethingSexy you're going to want to add the "module"
condition in the env
there and then it will use the "module"
field in the package.json defined. JSPM will convert CommonJS and UMD modules into ES modules, hence it adds a default export to make them importable.
@guybedford should it add that default export at the end of the file, outside of the System.register wrapper?
@SomethingSexy System modules aren't supported as input on JSPM - UMD modules are interepreted as CommonJS and thus given a default export. Add the "module"
condition to use the correct entry point for SingleSPA.
Got it! Thanks for the explanation. I think I might have something else going on with the version of single-spa being return from JSPM vs jsdelivr but I need to investigate further. This issue can be closed. Thanks again.
@SomethingSexy using:
defaultProvider: 'jspm',
env: ['production', 'browser', 'module']
should fix the issue as discussed above.
Sorry if this is the wrong place to ask this kind of specific question. I am using this library to generate some import maps. One of the dependencies is single-spa. The package is referencing version 5.9.3. When I pipe it through the generator using these settings
I am getting this
"single-spa":"https://ga.jspm.io/npm:single-spa@5.9.3/lib/umd/single-spa.min.js"
However, at the end of that file that it is pulling down is
;export default n;
Is there a reason that is being added? I don't see that in the npm version and I am not setting the env to 'module'. Am I missing some configuration somewhere? Thanks!