mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-16 22:03:53 +00:00
Added modules/modules-*.js to sync with public repo (#2278)
GitOrigin-RevId: 86cc5a7f9129fa774faa63b7a52cd5569dda7a5a
This commit is contained in:
parent
480ca112ff
commit
da7ef92668
2 changed files with 50 additions and 0 deletions
25
services/web/modules/modules-ide.js
Normal file
25
services/web/modules/modules-ide.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
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,
|
||||
'/public/src/ide/index.js'
|
||||
)
|
||||
if (fs.existsSync(entryPath)) {
|
||||
acc.push(entryPath)
|
||||
}
|
||||
return acc
|
||||
}, entryPoints)
|
||||
}
|
||||
|
||||
module.exports = function() {
|
||||
return {
|
||||
code: `define(['${entryPoints.join("', '")}'], function() {})`
|
||||
}
|
||||
}
|
25
services/web/modules/modules-main.js
Normal file
25
services/web/modules/modules-main.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
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,
|
||||
'/public/src/main/index.js'
|
||||
)
|
||||
if (fs.existsSync(entryPath)) {
|
||||
acc.push(entryPath)
|
||||
}
|
||||
return acc
|
||||
}, entryPoints)
|
||||
}
|
||||
|
||||
module.exports = function() {
|
||||
return {
|
||||
code: `define(['${entryPoints.join("', '")}'], function() {})`
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue