Files
yoga/javascript/package.json
vincentriemer 7c688cea68 Add babel processing to browser build to remove references to node builtins
Summary:
Currently the nbind asm.js output generates boilerplate code which can conditionally load node's `fs` and `path` modules. If this output is run directly in the browser there are no issues but if you run it through a bundler the build step will fail trying to resolve the node builtins.

Workarounds currently exist for bundlers like webpack (mentioned in #444) but this is not a safe assumption to make (for example such workarounds don't exist for `metro-bundler`).

I am by no means suggesting that this is the perfect solution but this might provide a stop-gap fix for people who are currently blocked by this issue (like I am).
Closes https://github.com/facebook/yoga/pull/585

Differential Revision: D5388660

Pulled By: emilsjolander

fbshipit-source-id: d3a51eb852df35e3d0610158fe7d9f5754e4e684
2017-07-10 12:00:37 -07:00

66 lines
2.2 KiB
JSON

{
"name": "yoga-layout",
"version": "1.5.0",
"description": "Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "git@github.com:facebook/yoga.git"
},
"main": "./sources/entry-node",
"browser": "./sources/entry-browser",
"config": {
"platform": "all"
},
"scripts": {
"which": "which",
"autogypi": "autogypi",
"node-gyp": "node-gyp",
"emcc-path": "emcc-path",
"is-monolithic": "test \"$(basename \"$(pwd)\")\" = javascript",
"copy-sources": "! npm -s -- run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)",
"build:node": "npm -- run copy-sources && npm -- run node-gyp configure build",
"build:browser": "npm -- run copy-sources && npm -- run node-gyp configure build --asmjs=1",
"postbuild:browser": "babel build/Release/nbind.js --out-file build/Release/nbind.js",
"build:standalone": "webpack",
"build:all": "npm -- run build:node && npm -- run build:browser && npm -- run build:standalone",
"build": "cross-env \"npm --if-present -- run build:$npm_package_config_platform\"",
"test:node": "TEST_ENTRY=node time mocha --expose-gc -r tests/tools.js tests/Facebook.Yoga/**/*.js",
"test:browser": "TEST_ENTRY=browser time mocha --expose-gc -r tests/tools.js tests/Facebook.Yoga/**/*.js",
"test:all": "npm -- run test:node && npm -- run test:browser",
"test": "npm -- run test:all",
"bench": "node tests/run-bench $(find tests/Benchmarks -name '*.js')",
"install": "npm -- run autogypi && npm -- run build:node",
"prepare": "npm -- run build:browser"
},
"dependencies": {
"autogypi": "^0.2.2",
"nbind": "^0.3.8",
"node-gyp": "^3.4.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-plugin-replace-require": "^0.0.4",
"cross-env": "^4.0.0",
"mocha": "^3.2.0",
"webpack": "^2.2.0-rc.2"
}
}