Skip to content

Commit 31975ff

Browse files
committed
WIP attempt at making "type":"module" work
1 parent 2032e16 commit 31975ff

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed
File renamed without changes.

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function (api) {
1+
export default function (api) {
22
api.cache(true);
33
return {
44
presets: ['@babel/preset-typescript'],

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@webgpu/cts",
33
"version": "0.1.0",
44
"description": "WebGPU Conformance Test Suite",
5+
"type": "module",
56
"scripts": {
67
"test": "grunt all",
78
"all": "grunt all",

src/common/runtime/helper/sys.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint no-process-exit: "off" */
22
/* eslint @typescript-eslint/no-namespace: "off" */
33

4-
function node() {
5-
const { existsSync } = require('fs');
4+
async function node() {
5+
const { existsSync } = await import('fs');
66

77
return {
88
type: 'node',
@@ -41,6 +41,6 @@ function deno() {
4141
};
4242
}
4343

44-
const sys = typeof globalThis.process !== 'undefined' ? node() : deno();
44+
const sys = typeof globalThis.process !== 'undefined' ? await node() : deno();
4545

4646
export default sys;

0 commit comments

Comments
 (0)