Skip to content

Commit c44b733

Browse files
fix: fix the build
1 parent b77d1c9 commit c44b733

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src
2+
assets

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
{
22
"name": "react-against-the-machine",
33
"version": "0.1.0",
4-
"main": "dist/index.js",
5-
"types": "dist/index.d.ts",
4+
"main": "./lib/cjs/index.js",
5+
"module": "./lib/esm/index.js",
6+
"types": "./lib/esm/index.d.ts",
67
"files": [
7-
"/dist"
8+
"/lib"
89
],
910
"engines": {
1011
"node": ">=16.8.0",
1112
"npm": "~7.24.0"
1213
},
1314
"type": "module",
1415
"scripts": {
15-
"build": "npx tsc",
16+
"build": "npm run build:esm && npm run build:cjs",
17+
"build:esm": "tsc",
18+
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
1619
"format": "prettier --write 'src/**/*.{ts,tsx,scss,css,json}'",
1720
"lint": "eslint --ext .js,.jsx,.ts,.tsx src --color",
1821
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx src --color --fix",

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ interface ITransitionProps<E> {
267267
onEnter?: OnEnterDataResponse<E>;
268268
}
269269

270+
// @ts-expect-error: Let's ignore a compile error
270271
export function Transition<E>(props: ITransitionProps<E>): null {
271272
return null;
272273
}

tsconfig.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
{
22
"compilerOptions": {
3-
"allowJs": true,
4-
"allowSyntheticDefaultImports": true,
3+
"outDir": "lib/esm",
4+
"module": "esnext",
5+
"target": "es5",
6+
"lib": ["es6", "dom", "es2016", "es2017"],
7+
"jsx": "react",
58
"declaration": true,
6-
"esModuleInterop": true,
7-
"forceConsistentCasingInFileNames": true,
8-
"isolatedModules": true,
9-
"jsx": "react-jsx",
10-
"module": "commonjs",
119
"moduleResolution": "node",
12-
"noEmit": true,
13-
"noFallthroughCasesInSwitch": true,
14-
"outDir": "dist",
15-
"resolveJsonModule": true,
16-
"skipLibCheck": true,
17-
"sourceMap": true,
18-
"strict": true,
19-
"target": "es6"
10+
"noUnusedLocals": true,
11+
"noUnusedParameters": true,
12+
"esModuleInterop": true,
13+
"noImplicitReturns": true,
14+
"noImplicitThis": true,
15+
"noImplicitAny": true,
16+
"strictNullChecks": true,
17+
"suppressImplicitAnyIndexErrors": true,
18+
"allowSyntheticDefaultImports": true
2019
},
21-
"files": ["src/index.tsx"],
22-
"exclude": ["test", "node_modules", "dist"]
20+
"include": ["src"],
21+
"exclude": ["node_modules", "lib", "src/**.mock.ts*", "src/**.test.tsx"]
2322
}

0 commit comments

Comments
 (0)