diff --git a/Gruntfile.js b/Gruntfile.cjs similarity index 100% rename from Gruntfile.js rename to Gruntfile.cjs diff --git a/babel.config.js b/babel.config.js index ad977bc510ee..f46ac79b1832 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,4 @@ -module.exports = function (api) { +export default function (api) { api.cache(true); return { presets: ['@babel/preset-typescript'], diff --git a/package.json b/package.json index 6f6b3b0df54b..27e7a017ae9f 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@webgpu/cts", "version": "0.1.0", "description": "WebGPU Conformance Test Suite", + "type": "module", "scripts": { "test": "grunt all", "all": "grunt all", diff --git a/src/common/runtime/helper/sys.ts b/src/common/runtime/helper/sys.ts index d2e07ff26d30..9ac9c929bfd5 100644 --- a/src/common/runtime/helper/sys.ts +++ b/src/common/runtime/helper/sys.ts @@ -1,8 +1,8 @@ /* eslint no-process-exit: "off" */ /* eslint @typescript-eslint/no-namespace: "off" */ -function node() { - const { existsSync } = require('fs'); +async function node() { + const { existsSync } = await import('fs'); return { type: 'node', @@ -41,6 +41,6 @@ function deno() { }; } -const sys = typeof globalThis.process !== 'undefined' ? node() : deno(); +const sys = typeof globalThis.process !== 'undefined' ? await node() : deno(); export default sys;