Skip to content

Commit 86b75d0

Browse files
committed
test(type-module-config-js-import-js): add test verifying the plugin with ESM webpack.config.js
1 parent cb5a1bb commit 86b75d0

File tree

7 files changed

+989
-0
lines changed

7 files changed

+989
-0
lines changed

index.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ test.serial("type-module-config-cjs-import-js", async t => {
2828
t.pass();
2929
});
3030

31+
test.serial("type-module-config-js-import-js", async t => {
32+
await buildTestProject("test-projects/type-module-config-js-import-js");
33+
t.pass();
34+
});
35+
3136
test.serial("backward-compatibility-pre-1.1.2-config-cjs", async t => {
3237
await buildTestProject("test-projects/backward-compatibility-pre-1.1.2-config-cjs");
3338
t.pass();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {test} from "./test.js";
2+
3+
test();
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"private": true,
3+
"name": "@softwareventures/resolve-typescript-plugin-test-type-module-config-js-import-js",
4+
"type": "module",
5+
"license": "ISC",
6+
"exports": {
7+
".": "./index.js"
8+
},
9+
"types": "index.d.ts",
10+
"scripts": {
11+
"build": "webpack"
12+
},
13+
"dependencies": {
14+
"tslib": "2.3.1"
15+
},
16+
"devDependencies": {
17+
"@softwareventures/tsconfig": "5.1.1",
18+
"resolve-typescript-plugin": "../..",
19+
"ts-loader": "9.2.8",
20+
"typescript": "4.6.3",
21+
"webpack": "5.72.0",
22+
"webpack-cli": "4.9.2"
23+
}
24+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export function test(): void {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "@softwareventures/tsconfig",
3+
"compilerOptions": {
4+
"declaration": false,
5+
"module": "ES2020"
6+
}
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {fileURLToPath} from "url";
2+
import {dirname} from "path";
3+
import ResolveTypeScriptPlugin from "resolve-typescript-plugin";
4+
5+
export default {
6+
mode: "production",
7+
context: dirname(fileURLToPath(import.meta.url)),
8+
entry: "./index.js",
9+
module: {
10+
rules: [
11+
{
12+
test: /\.tsx?$/,
13+
use: "ts-loader"
14+
}
15+
]
16+
},
17+
resolve: {
18+
plugins: [new ResolveTypeScriptPlugin()]
19+
}
20+
}

0 commit comments

Comments
 (0)