Skip to content

Commit

Permalink
feat: build 과정에서 tsc를 추갛나다
Browse files Browse the repository at this point in the history
  • Loading branch information
guesung committed Sep 20, 2024
1 parent ffc7c01 commit edc8ad4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/shared/build.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as esbuild from 'esbuild';
import dotenv from 'dotenv';
import { execSync } from 'child_process';
dotenv.config();

const define = {};
Expand All @@ -12,13 +13,24 @@ for (const k in process.env) {
* @type { import("esbuild").BuildOptions }
*/
const buildOptions = {
entryPoints: ['./index.ts', './src/**/*.ts', './src/**/*.tsx'],
tsconfig: './tsconfig.json',
tsconfig: 'tsconfig.json',
entryPoints: ['./src/**/*'],
bundle: false,
target: 'es6',
outdir: './dist',
sourcemap: true,
define,
plugins: [
{
name: 'TypeScriptDeclarationsPlugin',
setup(build) {
build.onEnd(result => {
if (result.errors.length > 0) return;
execSync('tsc');
});
},
},
],
};

await esbuild.build(buildOptions);

0 comments on commit edc8ad4

Please sign in to comment.