Skip to content

🐛 production mode broken #1000

Closed
Closed
@dnalborczyk

Description

@dnalborczyk

Prerequisites

Reproduction url

n/a

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

The following is broken since knip v5.44.5:

// package.json
{
  "type": "module",
  "scripts": {
    "start": "node src/index.ts"
  },
  "devDependencies": {
    "knip": "5.44.5"
  }
}

// knip.config.js
export default {
  entry: [
    "src/index.ts!",
  ],
  project: [
    "src/**!",
  ],
};
// src/index.ts
import foo from './foo.js'

console.log(foo)
// src/foo.ts
export default true
running `npx knip --production` logs:
Unused files (1)
src/foo.ts

Additional notes:

interestingly, removing the start script from package.json appears to fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions