mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 06:03:08 +00:00
399e834e36
[server-pro] faster local build GitOrigin-RevId: d71abde37253e4c0398afa6935290af79a1204be
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
const services = require('./services')
|
|
|
|
console.log('#!/bin/bash')
|
|
console.log('set -ex')
|
|
|
|
switch (process.argv.pop()) {
|
|
case 'install':
|
|
console.log('npm install --omit=dev')
|
|
break
|
|
case 'compile':
|
|
for (const service of services) {
|
|
console.log('pushd', `services/${service.name}`)
|
|
switch (service.name) {
|
|
case 'web':
|
|
// Avoid downloading of cypress
|
|
console.log('export CYPRESS_INSTALL_BINARY=0')
|
|
|
|
// install webpack and frontend dependencies
|
|
console.log('npm install --include=dev')
|
|
// run webpack
|
|
console.log('npm run webpack:production')
|
|
// uninstall webpack and frontend dependencies
|
|
console.log('npm install --omit=dev')
|
|
// precompile pug
|
|
console.log('npm run precompile-pug')
|
|
break
|
|
default:
|
|
console.log(`echo ${service.name} does not require a compilation`)
|
|
}
|
|
console.log('popd')
|
|
}
|
|
break
|
|
default:
|
|
console.error('unknown command')
|
|
console.log('exit 101')
|
|
process.exit(101)
|
|
}
|