mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
e035d526d6
Restructure frontend directories GitOrigin-RevId: 5a1224ca186f4809df45680a80d374c1c318d7bf
25 lines
545 B
JavaScript
25 lines
545 B
JavaScript
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const MODULES_PATH = path.join(__dirname, './')
|
|
|
|
const entryPoints = []
|
|
if (fs.existsSync(MODULES_PATH)) {
|
|
fs.readdirSync(MODULES_PATH).reduce((acc, module) => {
|
|
const entryPath = path.join(
|
|
MODULES_PATH,
|
|
module,
|
|
'/frontend/js/main/index.js'
|
|
)
|
|
if (fs.existsSync(entryPath)) {
|
|
acc.push(entryPath)
|
|
}
|
|
return acc
|
|
}, entryPoints)
|
|
}
|
|
|
|
module.exports = function() {
|
|
return {
|
|
code: `define(['${entryPoints.join("', '")}'], function() {})`
|
|
}
|
|
}
|