jspm / generator

JSPM Import Map Generator
Apache License 2.0
166 stars 21 forks source link

CommonJS install option #229

Closed guybedford closed 1 year ago

guybedford commented 1 year ago

Currently we explicitly trace CommonJS for Node.js import map workflows. We should instead make this a generation option - commonJS: true | false and by default it should be false.

When CommonJS is not enabled, we should then have a nice error that gets thrown as soon as CommonJS is traced:

throw new Error(`Unable to trace ${url}, as it is a CommonJS module. To enable CommonJS tracing set generatorOpts.commonJS = true`)