publish additional js/flatbuffers.mjs to npm to support ESModules in node (#4504)
This commit is contained in:
parent
53a897731e
commit
0e8a21854c
|
@ -81,3 +81,4 @@ android/build/
|
||||||
samples/android/.externalNativeBuild/
|
samples/android/.externalNativeBuild/
|
||||||
samples/android/.gradle/
|
samples/android/.gradle/
|
||||||
samples/android/build/
|
samples/android/build/
|
||||||
|
js/flatbuffers.mjs
|
|
@ -2,14 +2,17 @@
|
||||||
"name": "flatbuffers",
|
"name": "flatbuffers",
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"description": "Memory Efficient Serialization Library",
|
"description": "Memory Efficient Serialization Library",
|
||||||
"files": ["js/flatbuffers.js"],
|
"files": ["js/flatbuffers.js", "js/flatbuffers.mjs"],
|
||||||
"main": "js/flatbuffers.js",
|
"main": "js/flatbuffers",
|
||||||
|
"module": "js/flatbuffers.mjs",
|
||||||
"directories": {
|
"directories": {
|
||||||
"doc": "docs",
|
"doc": "docs",
|
||||||
"test": "tests"
|
"test": "tests"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "tests/JavaScriptTest.sh"
|
"test": "tests/JavaScriptTest.sh",
|
||||||
|
"append-esm-export": "sed \"s/this.flatbuffers = flatbuffers;/export { flatbuffers };/\" js/flatbuffers.js >> js/flatbuffers.mjs",
|
||||||
|
"prepublishOnly": "npm run append-esm-export"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Reference in New Issue