Skip to content

Commit 0227983

Browse files
committed
Add "chromeapp" field to package.json
I'm attempting to make a defacto standard for specifying Chrome App dependency substitutions using the `"chromeapp"` field in `package.json`. The `"chromeapp"` field is just like the [`"browser"` field in `package.json`](https://github.com/defunctzombie/package-browser-field-spec) except it's intended for Chrome Apps instead of a generic browser environment. Bundler tools like `browserify` or `webpack` can be configured to look for the `"chromeapp"` field instead of the `"browser"` field when doing a build for a Chrome App. In this specific package, since Chrome Apps can use raw sockets we want to replace e.g. `require('net')` with `require('chrome-net')`.
1 parent e3ec9da commit 0227983

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@
1616
"./lib/client/udp-tracker.js": false,
1717
"./server.js": false
1818
},
19+
"chromeapp": {
20+
"./server.js": false,
21+
"dgram": "chrome-dgram"
22+
},
1923
"bugs": {
2024
"url": "https://github.com/webtorrent/bittorrent-tracker/issues"
2125
},
2226
"dependencies": {
2327
"bencode": "^2.0.0",
2428
"bittorrent-peerid": "^1.0.2",
2529
"bn.js": "^5.0.0",
30+
"chrome-dgram": "^3.0.2",
2631
"compact2string": "^1.2.0",
2732
"debug": "^4.0.1",
2833
"ip": "^1.0.1",

0 commit comments

Comments
 (0)