Skip to content

Commit 8a57e3e

Browse files
committed
proof that exports are broken
1 parent 415618e commit 8a57e3e

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

.github/workflows/build.yml

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
id: test
3131
if: ${{ always() }}
3232
run: npm run test
33+
- name: CJS import
34+
run: node smoke-test-cjs.js
35+
- name: ESM import
36+
run: node smoke-test-esm.mjs
37+
- name: CJS and ESM import from CJS
38+
run: node smoke-test.js
3339
- name: lint
3440
if: ${{ always() }}
3541
run: npm run lint

smoke-test-cjs.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const TypeScriptLoader = require("./dist/cjs/index.js");
2+
TypeScriptLoader()

smoke-test-esm.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import TypeScriptLoader from "./dist/cjs/index.js";
2+
TypeScriptLoader()

smoke-test.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const assert = require('node:assert');
2+
3+
async function main() {
4+
const TypeScriptLoader1 = await import('./dist/cjs/index.js');
5+
const TypeScriptLoader2 = require('./dist/cjs/index.js');
6+
7+
assert.equal(TypeScriptLoader1.default, TypeScriptLoader2, 'TypeScriptLoader1 === TypeScriptLoader2');
8+
9+
// try to create loaders
10+
TypeScriptLoader1()
11+
TypeScriptLoader2()
12+
}
13+
14+
main()

0 commit comments

Comments
 (0)