--- /dev/null
+const wrt = require('../../browser/wrt');
+
+function run(app_id) {
+ console.log('wasm_builder.js start');
+ // sample
+ /*
+ let files = wrt.tv.enumerateWasmFiles(app_id);
+ files.forEach((file_path) => {
+ console.log(`file_path: ${file_path}`);
+ require(`${file_path}`);
+ });
+ */
+}
+
+module.exports = {
+ run
+}
\ No newline at end of file
process.exit();
});
+wrt.on('builtin-service', (event, internal_id, service_name) => {
+ console.log(`service_name: ${service_name}`);
+ const vm = require('vm');
+ let builtin_service = '';
+ if (service_name === 'wasm_builder') {
+ builtin_service = './builtins/wasm_builder.js';
+ }
+ if (builtin_service) {
+ console.log(`Builtin service is ${builtin_service}`);
+ let sandbox = {
+ console: console,
+ require: require,
+ };
+ let options = {
+ filename: internal_id,
+ };
+ let code = `require('${builtin_service}').run('${internal_id}')`;
+ vm.runInNewContext(code, sandbox, options);
+ }
+});
+
+wrt.on('quit', (event) => {
+ process.exit();
+});
+
process.on('exit', (code) => {
console.log('Exit with code : ' + code);
});