diff --git a/index.js b/index.js index 0523485..6e63e28 100644 --- a/index.js +++ b/index.js @@ -27,8 +27,12 @@ module.exports = function main ( for (const f of fs.readdirSync (modulefolder)) { const regex = /(?.*?)-(?.*?)\.js/u; const { groups } = regex.exec (f); - if ('undefined' !== typeof subdir) + + if ('undefined' === typeof subdir) + groups.url = `/${groups.url}/`; + else groups.url = `/${subdir}/${groups.url}/`; + groups.url = groups.url .replace (/^\/[^/]*\/root/iu, '/') .replace (/\./gu, '/')