Skip to content

Commit

Permalink
build: enable ts declarations in npm build
Browse files Browse the repository at this point in the history
  • Loading branch information
pheekus committed Jun 16, 2021
1 parent 79ebf20 commit c852e5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .build/compile-for-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ for await (const file of getMatchingFiles(SRC_DIR, /\.ts$/)) {
}
}

const sharedProgramOptions = await getCompilerOptions(TSCONFIG_PATH);
const programOptions = { ...sharedProgramOptions, declaration: true, declarationDir: 'dist' };
const result = ts
.createProgram({ rootNames: [ENTRY_PATH], options: await getCompilerOptions(TSCONFIG_PATH) })
.createProgram({ rootNames: [ENTRY_PATH], options: programOptions })
.emit(undefined, ts.sys.writeFile, undefined, undefined, { before: [injectCSS(cssSnippets)] });

process.exit(result.emitSkipped ? 1 : 0);
Expand Down

0 comments on commit c852e5a

Please sign in to comment.