You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently it works by all cjs first, then all esm first
as esm is one for all or nothing, it could be older, such as case with errlop, e.g. edition-2022, edition-2017, edition-es5, edition-2017-esm
editions autoloader doesn't support esm, to resolve this editions autoloader must be constrained to require/cjs modules, or support a esm dynamic import technique (of which node.js versions I am unsure)
here is some unfinished rewrite of the editions generate to go via newest node targets first, however it has several issues (it is dependent on targets answer order), and es versions de-duplication is tied to module technique where in this rewrite they are not
// add edition for each babel/typescript targetif(answers.compilerNode==='babel'||answers.compilerNode==='typescript'){// bug: es versions should be tied to importconstesVersionsTargets=newSet()for(constnodeVersionTargetofanswers.nodeVersionsTargeted.slice().reverse()){for(consttargetModuleofanswers.targetModules){if(targetModule==='import'){if(!versionRange(nodeVersionTarget,'>=12',// esm))continueif(answers.nodeVersionsTargetedImportRange&&!versionRange(nodeVersionTarget,answers.nodeVersionsTargetedImportRange,))continue}elseif(targetModule==='require'){if(answers.nodeVersionsTargetedRequireRange&&!versionRange(nodeVersionTarget,answers.nodeVersionsTargetedRequireRange,))continue}else{thrownewError(`invalid target module for the compiler`)}if(answers.compilerNode==='babel'){constdirectory=`edition-node-${nodeVersionTarget}`+(targetModule==='import' ? '-esm' : '')editions.set(directory,newEdition({compiler: 'babel',
directory,index: addExtension(answers.indexEntry,`js`),node: addExtension(answers.nodeEntry,`js`),browser: addExtension(answers.browserEntry,`js`),test: addExtension(answers.testEntry,`js`),bin: addExtension(answers.binEntry,`js`),tags: ['compiled','javascript',targetModule],targets: {node: nodeVersionTarget,},engines: {node: true,browsers: false,},}),)}elseif(answers.compilerNode==='typescript'){// fetch the latest es version for the node.js version target that typescript supportsconstesVersionTarget=intersect(allTypescriptTargets,awaitfetchAllCompatibleESVersionsForNodeVersions([nodeVersionTarget,]),)[0]// check that typescript supported itif(!esVersionTarget)continue// check that we haven't already generated an edition for this es version target targetif(esVersionsTargets.has(esVersionTarget))continueesVersionsTargets.add(esVersionTarget)// generate the editionconstesVersionTargetLower=esVersionTarget.toLowerCase()constdirectory=`edition-${esVersionTargetLower}`+(targetModule==='import' ? '-esm' : '')editions.set(directory,newEdition({compiler: 'typescript',
directory,index: addExtension(answers.indexEntry,`js`),node: addExtension(answers.nodeEntry,`js`),browser: addExtension(answers.browserEntry,`js`),test: addExtension(answers.testEntry,`js`),bin: addExtension(answers.binEntry,`js`),tags: ['compiled','javascript',esVersionTargetLower,targetModule,],targets: {node: nodeVersionTarget,es: esVersionTarget,},engines: {node: true,browsers: false,},}),)}else{thrownewError(`invalid target for the compiler`)}}}}
The text was updated successfully, but these errors were encountered:
currently it works by all cjs first, then all esm first
as esm is one for all or nothing, it could be older, such as case with errlop, e.g.
edition-2022
,edition-2017
,edition-es5
,edition-2017-esm
editions autoloader doesn't support esm, to resolve this editions autoloader must be constrained to require/cjs modules, or support a esm dynamic import technique (of which node.js versions I am unsure)
here is some unfinished rewrite of the editions generate to go via newest node targets first, however it has several issues (it is dependent on targets answer order), and es versions de-duplication is tied to module technique where in this rewrite they are not
The text was updated successfully, but these errors were encountered: