mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 15:51:39 +00:00
1be43911b4
Set Prettier's "trailingComma" setting to "es5" GitOrigin-RevId: 9f14150511929a855b27467ad17be6ab262fe5d5
25 lines
557 B
JavaScript
25 lines
557 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: entryPoints.map(entryPoint => `import '${entryPoint}'`).join('\n'),
|
|
}
|
|
}
|