Merge pull request #5039 from overleaf/jpa-web-metrics-module-pages

[web] modernize metrics module

GitOrigin-RevId: 24e9abd4b8aacacc4ed183c230a283d3d7afa281
This commit is contained in:
Jakob Ackermann 2021-09-15 14:10:45 +02:00 committed by Copybot
parent 42f9920a9e
commit 7923ceda6d

View file

@ -33,6 +33,19 @@ if (fs.existsSync(MODULES_PATH)) {
}, entryPoints)
}
// Add entrypoints for each "page"
glob
.sync(path.join(__dirname, 'modules/*/frontend/js/pages/**/*.js'))
.forEach(page => {
// in: /workspace/services/web/modules/foo/frontend/js/pages/bar.js
// out: modules/foo/pages/bar
const name = path
.relative(__dirname, page)
.replace(/frontend[/]js[/]/, '')
.replace(/.js$/, '')
entryPoints[name] = './' + path.relative(__dirname, page)
})
glob.sync(path.join(__dirname, 'frontend/js/pages/**/*.js')).forEach(page => {
// in: /workspace/services/web/frontend/js/pages/marketing/homepage.js
// out: pages/marketing/homepage