Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
fix(build): build should bundle ${app}.js file
Browse files Browse the repository at this point in the history
Content of this file might be different for different apps, e.g. worker calls Runtime.startWorker instead of Runtime.startApplication.
  • Loading branch information
alexkozy committed Jun 20, 2019
1 parent a2a8029 commit 97db6af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion front_end/ndb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Runtime.startApplication('ndb_app');
Runtime.startApplication('ndb');
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion scripts/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ async function buildApp(appNames, pathFolders, outFolder, minifyJS = code => cod
notAutoStartModules.add(module.name);
});

const appScript = await loadSource(pathFolders, appName + '.js');

let scriptContent = '';
scriptContent += '/* Runtime.js */\n' + runtime + '\n';
scriptContent += `allDescriptors.push(...${JSON.stringify(moduleDescriptors)});\n`;
scriptContent += `applicationDescriptor = ${JSON.stringify(appDescriptor)};\n`;
scriptContent += `Runtime.startApplication('${appName}');\n`;
scriptContent += appScript;
const visitedModule = new Set();
for (const [, module] of autoStartModulesByName)
scriptContent += writeModule(modules, module, autoStartModulesByName, visitedModule);
Expand Down

0 comments on commit 97db6af

Please sign in to comment.