这是indexloc提供的服务,不要输入任何密码
Skip to content

DTS files copied from publicDir are deleted in dts step #1366

@caveman-dick

Description

@caveman-dick

I have a package with some legacy js which I need to copy verbatim which includes some basic d.ts files. When running the build with clean enabled the files are being copied to the output directory but then subsequently deleted, which upon investgation seems to be happening in the dtsTask.

I tried using the onSuccess hook but it has the same issue:

onSuccess: async () => {
  fs.cpSync('./public', './dist/', { recursive: true });
}, 

I managed to workaround this issue by putting a delay in the onSuccess great than the DTS build step:

onSuccess: async () => {
  setTimeout(() => {
    fs.cpSync('./public', './dist/', { recursive: true });
   }, 5000);
}, 

Suggested resolution:

Run the publicDir and onSuccess tasks after the dtsTask and the mainTasks have completed. In fact I would think the onSuccess should be run after the publicDir.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions