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/.gradle/
|
||||
samples/android/build/
|
||||
js/flatbuffers.mjs
|
|
@ -2,14 +2,17 @@
|
|||
"name": "flatbuffers",
|
||||
"version": "1.8.0",
|
||||
"description": "Memory Efficient Serialization Library",
|
||||
"files": ["js/flatbuffers.js"],
|
||||
"main": "js/flatbuffers.js",
|
||||
"files": ["js/flatbuffers.js", "js/flatbuffers.mjs"],
|
||||
"main": "js/flatbuffers",
|
||||
"module": "js/flatbuffers.mjs",
|
||||
"directories": {
|
||||
"doc": "docs",
|
||||
"test": "tests"
|
||||
},
|
||||
"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": {
|
||||
"type": "git",
|
||||
|
|
Loading…
Reference in New Issue