Merge pull request #15120 from overleaf/jpa-mj-val-loader

[web] migrate modules-ide/modules-main from val-loader to babel macro

GitOrigin-RevId: 5114dab96d5bf34285ae42f539fed78e2f068a12
This commit is contained in:
Jakob Ackermann
2023-10-16 08:04:12 +00:00
committed by Copybot
parent a4c426744d
commit 95148980bc
6 changed files with 29 additions and 92 deletions
+2 -24
View File
@@ -1,25 +1,3 @@
const fs = require('fs')
const path = require('path')
import importOverleafModules from '../frontend/macros/import-overleaf-module.macro'
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/ide/index.js'
)
if (fs.existsSync(entryPath)) {
acc.push(entryPath)
}
return acc
}, entryPoints)
}
module.exports = function () {
return {
code: entryPoints.map(entryPoint => `import '${entryPoint}'`).join('\n'),
}
}
export default importOverleafModules('entryPointsIde')
+2 -24
View File
@@ -1,25 +1,3 @@
const fs = require('fs')
const path = require('path')
import importOverleafModules from '../frontend/macros/import-overleaf-module.macro'
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'),
}
}
export default importOverleafModules('entryPointsMain')