microbundle icon indicating copy to clipboard operation
microbundle copied to clipboard

Types haven't been bundled by microbundle

Open XaveScor opened this issue 1 year ago • 2 comments

Microbundle ignores *.ts files if they contain only types. Example of the file: https://github.com/XaveScor/signal-components/blob/dff96fd7151db5aae7421059836794a7880c2649/src/types.ts.

Reproduction:

git clone https://github.com/XaveScor/signal-components
git checkout tags/v0.11.0
pnpm install
pnpm build

Expected Result:

types.d.ts is included in the ./dist directory.

Actual Result:

types.d.ts does not exist. Types are broken because we have ./types imports, but the file is missing.

XaveScor avatar Jul 03 '24 11:07 XaveScor

Have you tried?

// your types
export {}

sergeysova avatar Jul 03 '24 17:07 sergeysova

Looks like this was fixed upstream in https://github.com/ezolenko/rollup-plugin-typescript2/pull/406, just haven't upgraded here yet.

Hopefully a postbuild cp src/type.d.ts dist/ isn't too much of a hassle for the time being.

rschristian avatar Jul 03 '24 22:07 rschristian