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-23 06:38:56 -08:00
|
|
|
if (process.env['SYNC'] == true && process.env['WASM'] == true) {
|
2022-12-23 00:43:57 -08:00
|
|
|
global.Yoga = require("./dist/sync.wasm");
|
2022-12-23 06:38:56 -08:00
|
|
|
} else if (process.env['SYNC'] == true) {
|
2022-12-23 00:43:57 -08:00
|
|
|
global.Yoga = require("./dist/sync.asmjs");
|
2022-12-23 06:38:56 -08:00
|
|
|
} else if (process.env['WASM'] == true) {
|
2022-12-23 03:08:21 -08:00
|
|
|
global.Yoga = await require("./dist/index.wasm").loadYoga();
|
2022-12-23 00:43:57 -08:00
|
|
|
} else {
|
2022-12-23 03:08:21 -08:00
|
|
|
global.Yoga = await require("./dist/index.asmjs").loadYoga();
|
2022-12-23 00:43:57 -08:00
|
|
|
}
|
2022-12-22 05:49:05 -08:00
|
|
|
}
|