Skip to content

Commit

Permalink
fix: Enforce type safety where ESBuild won't
Browse files Browse the repository at this point in the history
  • Loading branch information
AverageHelper committed Oct 29, 2023
1 parent 3b63493 commit 7e8a2c6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@rollup/plugin-json": "6.0.0",
"@rollup/plugin-node-resolve": "15.0.1",
"@rollup/plugin-replace": "5.0.2",
"@rollup/plugin-typescript": "11.1.5",
"@types/lodash-es": "4.17.8",
"@types/node": "20.8.8",
"@types/source-map-support": "0.5.6",
Expand Down
6 changes: 6 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import commonjs from '@rollup/plugin-commonjs';
import esbuild from 'rollup-plugin-esbuild';
import json from '@rollup/plugin-json';
import replace from '@rollup/plugin-replace';
import typescript from '@rollup/plugin-typescript';

const HOME = process.env['HOME'];
const NODE_ENV = process.env['NODE_ENV'];
Expand All @@ -23,6 +24,11 @@ export default defineConfig({
})
: null,

// Check types
typescript({
tsconfig: './tsconfig.prod.json',
}),

// Transpile source
esbuild({
tsconfig: './tsconfig.prod.json',
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"exclude": ["src/**/*.test.ts", "**/__mocks__/**/*.ts"],
"compilerOptions": {
"target": "ES2022",
"module": "CommonJS",
"module": "ESNext",
"lib": ["ES2022"],
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
Expand Down

0 comments on commit 7e8a2c6

Please sign in to comment.