Skip to content

Commit 779bb10

Browse files
committed
Try to do ES modules properly
1 parent 0a2b0f3 commit 779bb10

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const esbuild = require('esbuild');
1+
import * as esbuild from 'esbuild';
22

33
async function go() {
44
const args = process.argv.slice(2);

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "twelf-wasm",
3+
"type": "module",
34
"exports": {
45
"require": "./lib/encoding.cjs",
5-
"import": "./lib/encoding.mjs"
6+
"import": "./lib/encoding.js"
67
},
78
"types": "lib/encoding.d.ts",
89
"version": "0.1.7",
@@ -25,7 +26,7 @@
2526
"scripts": {
2627
"test": "jest",
2728
"test-watch": "jest --watch",
28-
"build-lib": "tsc --project tsconfig.lib.json && mv ./lib/encoding.js ./lib/encoding.mjs && node build-lib.js"
29+
"build-lib": "tsc --project tsconfig.lib.json && node build-lib.js"
2930
},
3031
"devDependencies": {
3132
"@codemirror/language": "^6.10.1",
@@ -42,7 +43,7 @@
4243
"files": [
4344
"package.json",
4445
"README.md",
45-
"lib/encoding.mjs",
46+
"lib/encoding.js",
4647
"lib/encoding.cjs",
4748
"lib/encoding.cjs.map",
4849
"lib/encoding.d.ts"

0 commit comments

Comments
 (0)