Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why doesn't the flag --env.NODE_ENV and the option --onSuccess take effect? #1108

Open
Crownico opened this issue Apr 22, 2024 · 0 comments
Open

Comments

@Crownico
Copy link

Crownico commented Apr 22, 2024

I would like the generated results to be automatically executed following the successful completion of the compilation process, and for that compilation to utilize the configuration corresponding to the specific environment.

"scripts": {
    "dev": "tsup --watch --env.NODE_ENV development --onSuccess 'node dist/app.js'"
}
// tsup.config.ts
import { defineConfig } from "tsup";

const isDev = process.env.NODE_ENV === "development";

console.log("isDev", process.env.NODE_ENV); 

export default defineConfig({
    target: "es2020",
    entry: ["lib/app.ts"],
    outDir: "dist",
    format: ["cjs", "esm"],
    dts: !isDev,
    minify: !isDev,
    clean: true,
    sourcemap: isDev
});

result:

image

Why doesn't the flag --env.NODE_ENV and the option --onSuccess take effect?
What should I do?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant