WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Minify cause errors with Express routes #462

@throrin19

Description

@throrin19

Reproduction link or steps

Hello, It is really compicated to me to set this project, this is a private project inside a big monorepo.

So, I use express v5 and I try to launch builded code. When I use tsdown without minify, all is good. When I run with minify code, all express routes return 404 with no reason (I have no exception in my code).
I think minify part rewrite all express regexp part to retrieve routes.

What is expected?

All express routes return 404 when code is minify

What is actually happening?

All works fine with or without minify enabled

Any additional comments?

This is my tsdown config :

import { defineConfig } from 'tsdown';

export default defineConfig({
    entry: ['index.ts'],
    external: ['pg', 'pg-query-stream', 'better-sqlite3', 'tedious', 'mysql', 'oracledb', 'sqlite3'],
    format: 'esm',
    minify: true,
    nodeProtocol: true,
    noExternal: [/^(?!(pg|better-sqlite3|tedious|mysql|oracledb|sqlite3)).*$/],
    platform: 'node',
    shims: true,
    sourcemap: true,
    treeshake: true,
    tsconfig: 'tsconfig.json',
    watch: false,
});

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions