Skip to content

Commit b8e51c2

Browse files
committed
fix ESM support
1 parent bc3af80 commit b8e51c2

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ If you support IE11, import `core-js` in your application entrypoints, as this l
481481

482482
NodeJS v10 is required, but NodeJS v12 or later is recommended because it includes the V8 feature of [Improving DataView performance in V8](https://v8.dev/blog/dataview).
483483

484-
NodeJS before v10 will work by importing `@msgpack/msgpack/dist.es5/msgpack`.
484+
NodeJS before v10 will work by importing `@msgpack/msgpack/dist.es5+umd/msgpack`.
485485

486486
### TypeScript
487487

@@ -522,9 +522,10 @@ Note that `Buffer.from()` for `JSON.stringify()` is necessary to emulate I/O whe
522522
The NPM package distributed in npmjs.com includes both ES2015+ and ES5 files:
523523

524524
* `dist/` is compiled into ES2015+
525-
* `dist.es5/` is compiled into ES5 and bundled to singile file
526-
* `dist.es5/msgpack.min.js` - the default, minified file (UMD)
527-
* `dist.es5/msgpack.js` - an optional, non-minified file (UMD)
525+
* `dist.es5+umd/` is compiled into ES5 and bundled to singile file
526+
* `dist.es5+umd/msgpack.min.js` - the default, minified file (UMD)
527+
* `dist.es5+umd/msgpack.js` - an optional, non-minified file (UMD)
528+
* `dist.es5+esm/` is compiled into ES5 and placed as ES modules
528529

529530
If you use NodeJS and/or webpack, their module resolvers use the suitable one automatically.
530531

example/amd-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<script src="../dist.es5/msgpack.min.js"></script>
4+
<script src="../dist.es5+umd/msgpack.min.js"></script>
55
<style>
66
main {
77
width: 80%;

example/fetch-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="UTF-8">
6-
<script src="../dist.es5/msgpack.min.js"></script>
6+
<script src="../dist.es5+umd/msgpack.min.js"></script>
77
<style>
88
main {
99
width: 80%;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"files": [
9090
"src/**/*.*",
9191
"dist/**/*.*",
92-
"dist.es5/**/*.*",
92+
"dist.es5+umd/**/*.*",
9393
"dist.es5+esm/**/*.*"
9494
]
9595
}

tsconfig.test-dist-es5-purejs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"outDir": "./build/test-dist-es5-purejs",
55
"noImplicitAny": false,
66
"paths": {
7-
"@msgpack/msgpack": ["./dist.es5/msgpack"]
7+
"@msgpack/msgpack": ["./dist.es5+umd/msgpack"]
88
}
99
}
1010
}

0 commit comments

Comments
 (0)