update comment

This commit is contained in:
Maidul Islam
2024-02-06 12:22:04 -05:00
parent b3d4787e21
commit 8de2302d98
+7 -7
View File
@@ -5,13 +5,13 @@ import fs from "fs/promises";
import { replaceTscAliasPaths } from "tsc-alias"; import { replaceTscAliasPaths } from "tsc-alias";
import { defineConfig } from "tsup"; import { defineConfig } from "tsup";
// what you need tsup to build instead of tsx or tsc // Instead of using tsx or tsc for building, consider using tsup.
// tsx is a drop in replacement for nodejs - rather build on top of nodejs runtime // TSX serves as an alternative to Node.js, allowing you to build directly on the Node.js runtime.
// it works exactly like node only catch is it doesn't have a final build step else prod should be started with tsx // Its functionality mirrors Node.js, with the only difference being the absence of a final build step. Production should ideally be launched with TSX.
// tsc is great for final build issue is we need to then do a manual copy of all static files like handlebar email etc // TSC is effective for creating a final build, but it requires manual copying of all static files such as handlebars, emails, etc.
// another issue is commonjs. final output needs to be esm because more and more packages are migrating to esm // A significant challenge is the shift towards ESM, as more packages are adopting ESM. If the output is in CommonJS, it may lead to errors.
// if the final output is commonjs it will just throw an error // The suggested configuration offers a balance, accommodating both ESM and CommonJS requirements.
// the below configuration is best of both worlds
export default defineConfig({ export default defineConfig({
shims: true, shims: true,
clean: true, clean: true,