diff options
author | Paul Taylor <paul.e.taylor@me.com> | 2017-12-01 14:18:43 -0800 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2017-12-01 14:18:43 -0800 |
commit | 0e8a21854caffb978046e33ffeb26b60af9de31c (patch) | |
tree | 7d22fd8fd42c669620d2f4311bfe57555a7277f4 /package.json | |
parent | 53a897731e23320e67602d3d4c56e09caffb98ca (diff) | |
download | flatbuffers-0e8a21854caffb978046e33ffeb26b60af9de31c.tar.gz flatbuffers-0e8a21854caffb978046e33ffeb26b60af9de31c.tar.bz2 flatbuffers-0e8a21854caffb978046e33ffeb26b60af9de31c.zip |
publish additional js/flatbuffers.mjs to npm to support ESModules in node (#4504)
Diffstat (limited to 'package.json')
-rw-r--r-- | package.json | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/package.json b/package.json index dc767154..65169c0f 100644 --- a/package.json +++ b/package.json @@ -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", |