Skip to content

Commit 80f9479

Browse files
test: rewrite
1 parent cd4f1f2 commit 80f9479

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

test/build/config-format/typescript-cjs-using-nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"type": "module",
2+
"type": "commonjs",
33
"engines": {
44
"node": ">=18.12.0"
55
}

test/build/config-format/typescript-cjs-using-nodejs/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"target": "esnext",
44
"allowImportingTsExtensions": true,
55
"rewriteRelativeImportExtensions": true,
6-
"module": "esnext"
6+
"module": "commonjs"
77
}
88
}

test/build/config-format/typescript-cjs-using-nodejs/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from "node:path";
1+
const path = require("node:path");
22

33
/* eslint-disable no-useless-concat */
44

@@ -13,4 +13,4 @@ const config = {
1313
},
1414
};
1515

16-
export default config;
16+
module.exports = config;

test/build/config-format/typescript-mjs-using-nodejs/typescript.test.js renamed to test/build/config-format/typescript-mjs-using-nodejs/typescript.test.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
const { existsSync } = require("node:fs");
2-
const { resolve } = require("node:path");
3-
const { run } = require("../../../utils/test-utils");
1+
import { existsSync } from "node:fs";
2+
import { dirname, resolve } from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import { run } from "../../../utils/test-utils.js";
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = dirname(__filename);
48

59
describe("webpack cli", () => {
610
it("should support typescript esnext file", async () => {

0 commit comments

Comments
 (0)