0👍
✅
Easy, just check for lang === 'en'
in your map function.
module.exports = [].concat.apply([],
langs.map(lang =>
pages.map(page => lang === 'en' ? `/${page}` : `/${lang}/${page}`)))
Just be careful as read in comments, if you use to read url params for defining langage or if your url scheme needs to be '/something/otherthing'
.
Source:stackexchange.com