Skip to content

Commit 6e18a0c

Browse files
mupandrehgdias
mup
authored andcommitted
Fixes build scripts
After splitting the worker into two, we forgot to set the correct path for the built worker to worker-bootstrap. Now it gets the correct location depending on which app is being built. It also adds a new test to the github pipeline to ensure that both apps can be built using the rollup and respect the import rules.
1 parent 5c016fc commit 6e18a0c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ jobs:
9292
- name: build web app
9393
run: |
9494
node webapp --disable-minify
95+
- name: build calendar web app
96+
run: |
97+
node webapp --disable-minify --app calendar
9598
- name: check for FIXMEs
9699
run: |
97100
if grep "FIXME\|[fF]ixme" -r src buildSrc test/tests packages/*/lib app-android/app/src app-ios/tutanota/Sources; then

buildSrc/buildWebapp.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export async function buildWebapp({ version, stage, host, measure, minify, proje
3434
const buildDir = isCalendarApp ? "build-calendar-app" : "build"
3535
const entryFile = isCalendarApp ? "src/calendar-app/calendar-app.ts" : "src/mail-app/app.ts"
3636
const workerFile = isCalendarApp ? "src/calendar-app/workerUtils/worker/calendar-worker.ts" : "src/mail-app/workerUtils/worker/mail-worker.ts"
37+
const builtWorkerFile = isCalendarApp ? "calendar-worker.js" : "mail-worker.js"
3738

3839
console.log("Building app", app)
3940

@@ -146,7 +147,7 @@ export async function buildWebapp({ version, stage, host, measure, minify, proje
146147
await fs.promises.writeFile(
147148
`${buildDir}/worker-bootstrap.js`,
148149
`importScripts("./polyfill.js")
149-
const importPromise = System.import("./worker.js")
150+
const importPromise = System.import("./${builtWorkerFile}")
150151
self.onmessage = function (msg) {
151152
importPromise.then(function () {
152153
self.onmessage(msg)

0 commit comments

Comments
 (0)