@@ -93,7 +93,7 @@ async function buildVersionsMenuList(versions, currentVersion, section) {
9393 for ( const v of versions ) {
9494 const activityClass = v . label === currentVersion && ! v . default ? ' class="active"' : '' ;
9595 const defaultBadge = v . default ? ' (default)' : '' ;
96- const versionPath = v . default ? '' : `${ v . label } /` ;
96+ const versionPath = v . default ? '' : `${ v . path ?? v . label } /` ;
9797 versionsMenuHtml += `<a href="./${ versionPath } ${ section } "${ activityClass } >${ v . label } ${ defaultBadge } </a>` ;
9898 }
9999 versionsMenuHtml += '</div>' ;
@@ -232,8 +232,9 @@ async function buildPlaygrounds(template, versions) {
232232}
233233
234234async function buildPlayground ( template , version , versions ) {
235- const bundleScript = `<script nomodule src="${ config . bundlesPath } /${ version . label } /${ config . bundleName } "></script>` ;
236- const bundleESModulesScript = `<script type="module" src="${ config . bundlesPath } /${ version . label } /${ config . bundleNameESModules } "></script>` ;
235+ const versionPath = version . path ?? version . label ;
236+ const bundleScript = `<script nomodule src="${ config . bundlesPath } /${ versionPath } /${ config . bundleName } "></script>` ;
237+ const bundleESModulesScript = `<script type="module" src="${ config . bundlesPath } /${ versionPath } /${ config . bundleNameESModules } "></script>` ;
237238 const babelScript = '<script src="./babel.min.js"></script>' ;
238239 const playgroundContent = await readFileContent ( `${ config . srcDir } playground.html` ) ;
239240 const versionsMenu = await buildVersionsMenu ( versions , version . label , 'playground' ) ;
@@ -244,7 +245,7 @@ async function buildPlayground(template, version, versions) {
244245 playground = playground . replace ( '{core-js-bundle-esmodules}' , bundleESModulesScript ) ;
245246 playground = playground . replace ( '{babel-script}' , babelScript ) ;
246247 const playgroundWithVersion = playground . replace ( '{versions-menu}' , versionsMenu ) ;
247- const playgroundFilePath = path . join ( config . resultDir , version . label , 'playground.html' ) ;
248+ const playgroundFilePath = path . join ( config . resultDir , versionPath , 'playground.html' ) ;
248249
249250 if ( version . default ) {
250251 const defaultVersionsMenu = await buildVersionsMenu ( versions , version . label , 'playground' ) ;
@@ -264,10 +265,11 @@ async function createDocsIndexes(versions) {
264265
265266 for ( const version of versions ) {
266267 if ( version . default ) continue ;
267- const menuItems = await getDocsMenuItems ( version . label ) ;
268+ const versionPath = version . path ?? version . label ;
269+ const menuItems = await getDocsMenuItems ( versionPath ) ;
268270 const firstDocPath = path . join ( config . resultDir ,
269- `${ menuItems [ 0 ] . url } .html` . replace ( `{docs-version}${ BRANCH ? '/' : '' } ` , version . label ) ) ;
270- const indexFilePath = path . join ( config . resultDir , `${ version . label } /docs/` , 'index.html' ) ;
271+ `${ menuItems [ 0 ] . url } .html` . replace ( `{docs-version}${ BRANCH ? '/' : '' } ` , versionPath ) ) ;
272+ const indexFilePath = path . join ( config . resultDir , `${ versionPath } /docs/` , 'index.html' ) ;
271273 await copy ( firstDocPath , indexFilePath ) ;
272274 echo ( chalk . green ( `File created: ${ indexFilePath } ` ) ) ;
273275 }
0 commit comments