mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-16 19:21:19 +00:00
Merge pull request #5040 from overleaf/jpa-web-templates-page
[web] v2-templates module: refactor frontend entrypoint into page GitOrigin-RevId: 2efe344167cba3111eb516ebc2dfadd82347f776
This commit is contained in:
parent
7923ceda6d
commit
23c4f9462b
1 changed files with 0 additions and 14 deletions
|
@ -1,4 +1,3 @@
|
|||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const glob = require('glob')
|
||||
const webpack = require('webpack')
|
||||
|
@ -8,8 +7,6 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|||
|
||||
const PackageVersions = require('./app/src/infrastructure/PackageVersions')
|
||||
|
||||
const MODULES_PATH = path.join(__dirname, '/modules')
|
||||
|
||||
// Generate a hash of entry points, including modules
|
||||
const entryPoints = {
|
||||
serviceWorker: './frontend/js/serviceWorker.js',
|
||||
|
@ -22,17 +19,6 @@ const entryPoints = {
|
|||
'light-style': './frontend/stylesheets/light-style.less',
|
||||
}
|
||||
|
||||
// Attempt to load frontend entry-points from modules, if they exist
|
||||
if (fs.existsSync(MODULES_PATH)) {
|
||||
fs.readdirSync(MODULES_PATH).reduce((acc, module) => {
|
||||
const entryPath = path.join(MODULES_PATH, module, '/frontend/js/index.js')
|
||||
if (fs.existsSync(entryPath)) {
|
||||
acc[module] = entryPath
|
||||
}
|
||||
return acc
|
||||
}, entryPoints)
|
||||
}
|
||||
|
||||
// Add entrypoints for each "page"
|
||||
glob
|
||||
.sync(path.join(__dirname, 'modules/*/frontend/js/pages/**/*.js'))
|
||||
|
|
Loading…
Reference in a new issue