Skip to content

Commit cc20cb5

Browse files
authored
Rename index.esm.js -> esm.mjs (#249 take 2) (#257)
* Rename index.esm.js -> esm.mjs This is needed for node to properly deduce that the file is ESM. Otherwise, node crashes when you try to `import("vectorious")` with an error like: > Uncaught SyntaxError: Unexpected token 'export' * 6.1.12
1 parent 274fbee commit cc20cb5

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ It exposes a global variable named `v` in the `window` object and can be accesse
5050

5151
#### ES module
5252

53-
Added in version 6.1.0, vectorious exposes an ES module bundle at `dist/index.esm.js` which can be imported using the `import` syntax:
53+
Added in version 6.1.0, vectorious exposes an ES module bundle at `dist/index.mjs` which can be imported using the `import` syntax:
5454

5555
```typescript
5656
import { array } from 'vectorious';

dist/index.esm.js renamed to dist/index.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
File renamed without changes.

docs/vectorious/6.1.11/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ <h4>Browser</h4>
140140
&lt;/script>
141141
</code></pre>
142142
<h4>ES module</h4>
143-
<p>Added in version 6.1.0, vectorious exposes an ES module bundle at <code>dist/index.esm.js</code> which can be imported using the <code>import</code> syntax:</p>
143+
<p>Added in version 6.1.0, vectorious exposes an ES module bundle at <code>dist/index.mjs</code> which can be imported using the <code>import</code> syntax:</p>
144144
<pre class="prettyprint source lang-typescript"><code>import { array } from 'vectorious';
145145

146146
const x = array([1, 2, 3]);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "vectorious",
3-
"version": "6.1.11",
3+
"version": "6.1.12",
44
"description": "A high performance linear algebra library.",
55
"main": "dist/index.js",
66
"browser": "dist/index.browser.js",
7-
"module": "dist/index.esm.js",
7+
"module": "dist/index.mjs",
88
"types": "dist/index.d.ts",
99
"files": [
1010
"dist"
1111
],
1212
"exports": {
1313
".": {
1414
"require": "./dist/index.js",
15-
"import": "./dist/index.esm.js"
15+
"import": "./dist/index.mjs"
1616
}
1717
},
1818
"scripts": {
@@ -21,7 +21,7 @@
2121
"docs": "tsc --outDir built && jsdoc --configure jsdoc.json && rimraf built",
2222
"build:node": "esbuild --bundle src/index.ts --minify --sourcemap --platform=node --outfile=dist/index.js --external:nblas --external:nlapack",
2323
"build:browser": "esbuild --bundle src/index.ts --minify --sourcemap --platform=browser --global-name=v --outfile=dist/index.browser.js --external:nblas --external:nlapack",
24-
"build:esm": "esbuild --bundle src/index.ts --minify --sourcemap --format=esm --outfile=dist/index.esm.js --external:nblas --external:nlapack",
24+
"build:esm": "esbuild --bundle src/index.ts --minify --sourcemap --format=esm --outfile=dist/index.mjs --external:nblas --external:nlapack",
2525
"build": "rimraf dist && tsc -emitDeclarationOnly && npm run build:node && npm run build:browser && npm run build:esm",
2626
"prepublishOnly": "npm run build"
2727
},

0 commit comments

Comments
 (0)