Skip to content

const enum not inlined #156

@magicdawn

Description

@magicdawn

Describe the bug

src/demo.ts

const enum Prop {
  Display = 1,
  Isolation,
  Position,
}
console.log(Prop.Display)

tsdown@^0.9.8

tsdown.config.ts

import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: ['./src/demo.ts'],
  outDir: 'dist',
  format: 'esm',
  target: 'node16',
  clean: true,
  dts: true,
  minify: true,
  noExternal: ['es-toolkit'],
})

Image

Reproduction

see the GIF

System Info

System:
    OS: macOS 15.4.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 99.69 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.local/state/fnm_multishells/86831_1745648882839/bin/node
    Yarn: 1.22.22 - ~/Library/pnpm/yarn
    npm: 10.9.2 - ~/.local/state/fnm_multishells/86831_1745648882839/bin/npm
    pnpm: 10.8.0 - ~/Library/pnpm/pnpm
    bun: 1.2.10 - /opt/homebrew/bin/bun
  Browsers:
    Brave Browser: 133.1.75.180
    Chrome: 135.0.7049.115
    Edge: 135.0.3179.98
    Safari: 18.4

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions