Skip to content

Commit 298d264

Browse files
authored
Fix file extensions in package.json (#156)
After recent renaming of dist/* files, some file names were not updated in package.json. This causes issues, specifically in node.js when you do `import { JSONPath } from 'jsonpath-plus'`, you'll get an error because it tries to access a non-existent file based on package.json `main` field.
1 parent 4487aae commit 298d264

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/ts/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ <h3>Node.js</h3>
137137
<a href="#browser" id="browser" style="color: inherit; text-decoration: none;">
138138
<h3>Browser</h3>
139139
</a>
140-
<p>For browser usage you can directly include <code>dist/index-browser-umd.js</code>; no Browserify
140+
<p>For browser usage you can directly include <code>dist/index-browser-umd.cjs</code>; no Browserify
141141
magic is necessary:</p>
142142
<pre><code class="language-html"><span style="color: #008000">&lt;!-- Polyfill recommended by Babel for items not covered for older</span>
143143
<span style="color: #008000"> browsers in dist --&gt;</span>
144144
<span style="color: #800000">&lt;script</span><span style="color: #000000FF"> </span><span style="color: #FF0000">src</span><span style="color: #000000FF">=</span><span style="color: #0000FF">&quot;node_modules/core-js-bundle/minified.js&quot;</span><span style="color: #800000">&gt;&lt;/script&gt;</span>
145145

146-
<span style="color: #800000">&lt;script</span><span style="color: #000000FF"> </span><span style="color: #FF0000">src</span><span style="color: #000000FF">=</span><span style="color: #0000FF">&quot;node_modules/jsonpath-plus/dist/index-browser-umd.js&quot;</span><span style="color: #800000">&gt;&lt;/script&gt;</span>
146+
<span style="color: #800000">&lt;script</span><span style="color: #000000FF"> </span><span style="color: #FF0000">src</span><span style="color: #000000FF">=</span><span style="color: #0000FF">&quot;node_modules/jsonpath-plus/dist/index-browser-umd.cjs&quot;</span><span style="color: #800000">&gt;&lt;/script&gt;</span>
147147

148148
<span style="color: #800000">&lt;script&gt;</span>
149149

@@ -646,4 +646,4 @@ <h2>Legend</h2>
646646
<div class="overlay"></div>
647647
<script src="assets/js/main.js"></script>
648648
</body>
649-
</html>
649+
</html>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "jsonpath-plus",
44
"version": "6.0.0",
55
"type": "module",
6-
"main": "dist/index-node-cjs.js",
6+
"main": "dist/index-node-cjs.cjs",
77
"exports": {
88
"./package.json": "./package.json",
99
".": {
@@ -14,7 +14,7 @@
1414
"default": "./dist/index-browser-esm.js"
1515
}
1616
},
17-
"module": "dist/index-node-esm.mjs",
17+
"module": "dist/index-node-esm.js",
1818
"browser": "dist/index-browser-esm.js",
1919
"types": "./src/jsonpath.d.ts",
2020
"description": "A JS implementation of JSONPath with some additional operators",

0 commit comments

Comments
 (0)