2022-12-22 05:49:05 -08:00
|
|
|
/**
|
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*
|
|
|
|
* @format
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = async () => {
|
2022-12-24 01:46:20 -08:00
|
|
|
if (process.env["SYNC"] == true && process.env["WASM"] == true) {
|
2022-12-23 23:49:35 -08:00
|
|
|
global.Yoga = require("./dist/entrypoint/wasm-sync");
|
2022-12-24 01:46:20 -08:00
|
|
|
} else if (process.env["SYNC"] == true) {
|
2022-12-23 23:49:35 -08:00
|
|
|
global.Yoga = require("./dist/entrypoint/asmjs-sync");
|
2022-12-24 01:46:20 -08:00
|
|
|
} else if (process.env["WASM"] == true) {
|
2022-12-23 23:49:35 -08:00
|
|
|
global.Yoga = await require("./dist/entrypoint/wasm-async").loadYoga();
|
2022-12-23 00:43:57 -08:00
|
|
|
} else {
|
2022-12-23 23:49:35 -08:00
|
|
|
global.Yoga = await require("./dist/entrypoint/asmjs-async").loadYoga();
|
2022-12-23 00:43:57 -08:00
|
|
|
}
|
2022-12-24 01:46:20 -08:00
|
|
|
};
|