Skip to content

Commit 4f87c9f

Browse files
committed
Welp the npmrc thing didn't work. Try removing yoga from dependencies altogether and just installing it at the time the build-yoga script is executed.
1 parent d3c987e commit 4f87c9f

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

.npmrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
registry=https://registry.npmjs.org/
2-
yoga-layout:platform = "none"

packages/troika-3d-ui/libs/yoga.factory.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ var Yoga = (function () {
362362
}, YGEnums);
363363
};
364364

365-
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
365+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
366366

367367
function commonjsRequire () {
368368
throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
@@ -472,7 +472,9 @@ var Yoga = (function () {
472472
console.warn(x);
473473
};
474474
} else {
475-
if (!Module["print"]) Module["print"] = function (x) {};
475+
var TRY_USE_DUMP = false;if (!Module["print"]) Module["print"] = TRY_USE_DUMP && typeof dump !== "undefined" ? function (x) {
476+
dump(x);
477+
} : function (x) {};
476478
}if (ENVIRONMENT_IS_WORKER) {
477479
Module["load"] = importScripts;
478480
}if (typeof Module["setWindowTitle"] === "undefined") {

packages/troika-3d-ui/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
"troika-core": "^0.13.0",
2121
"troika-worker-utils": "^0.13.0"
2222
},
23-
"devDependencies": {
24-
"yoga-layout": "^1.9.3"
25-
},
2623
"scripts": {
27-
"build-yoga": "rollup -c rollup.config.build-yoga.js"
24+
"build-yoga": "npm install --ignore-scripts --no-save [email protected] && rollup -c rollup.config.build-yoga.js"
2825
}
2926
}

packages/troika-3d-ui/rollup.config.build-yoga.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ import nodeResolve from 'rollup-plugin-node-resolve'
66
import commonjs from 'rollup-plugin-commonjs'
77

88

9-
const {LERNA_ROOT_PATH} = process.env
10-
if (!LERNA_ROOT_PATH) {
11-
throw new Error("Please execute `npm run build-yoga` from the repository root.")
12-
}
13-
14-
159
const OUTPUT_TEMPLATE = `
1610
// Custom build of Yoga (https://yogalayout.com/) for use in Troika UI layout.
1711
// Original MIT license applies: https://github.com/facebook/yoga/blob/master/LICENSE
@@ -27,7 +21,7 @@ const [banner, footer] = OUTPUT_TEMPLATE.split('$$CONTENT$$')
2721

2822

2923
export default {
30-
input: LERNA_ROOT_PATH + '/node_modules/yoga-layout/dist/entry-browser.js',
24+
input: './node_modules/yoga-layout/dist/entry-browser.js',
3125
plugins: [
3226
nodeResolve(),
3327
commonjs()

0 commit comments

Comments
 (0)