Skip to content

bug: copy no longer treat to as full path of target or should mark as breaking #650

@nekomeowww

Description

@nekomeowww

Reproduction link or steps

https://stackblitz.com/edit/github-q5kq15gz?file=tsdown.config.ts

import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: ['src/index.ts'],
  external: ['./index.css'],
  copy: [
    { from: 'src/index.css', to: 'dist/index.css' },
  ],
  unbundle: true,
})

What is expected?

Copying files from src/index.css to dist/index.css

What is actually happening?

Copying files from src/index.css to dist/index.css/index.css

Any additional comments?

Workaround:

import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: ['src/index.ts'],
  external: ['./index.css'],
  copy: [
--    { from: 'src/index.css', to: 'dist/index.css' },
++    { from: 'src/index.css', to: 'dist' },
  ],
  unbundle: true,
})

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions