I have only one file in src/index.ts
{
"name": "react-modern-calendar",
"version": "0.0.1",
"license": "MIT",
"source": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.module.js",
"unpkg": "dist/index.umd.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "microbundle",
"dev": "microbundle watch"
}
}
$ microbundle
rpt2: options error TS6053: File '/mnt/ssd/repositories/react-modern-calendar/dist/index.d.ts' not found.
(rpt2 plugin) Error: Could not find source file: '/mnt/ssd/repositories/react-modern-calendar/dist/index.d.ts'.
Error: Could not find source file: '/mnt/ssd/repositories/react-modern-calendar/dist/index.d.ts'.
at getValidSourceFile (/mnt/ssd/repositories/react-modern-calendar/node_modules/typescript/lib/typescript.js:139148:29)
at Object.getEmitOutput (/mnt/ssd/repositories/react-modern-calendar/node_modules/typescript/lib/typescript.js:139533:30)
at /mnt/ssd/repositories/react-modern-calendar/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27438:40
at arrayEach (/mnt/ssd/repositories/react-modern-calendar/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:534:11)
at forEach (/mnt/ssd/repositories/react-modern-calendar/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:9360:14)
at Object._onwrite (/mnt/ssd/repositories/react-modern-calendar/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27429:13)
at Object.generateBundle (/mnt/ssd/repositories/react-modern-calendar/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27402:27)
at /mnt/ssd/repositories/react-modern-calendar/node_modules/rollup/dist/shared/node-entry.js:13117:25
at processTicksAndRejections (internal/process/task_queues.js:93:5)
The solution is to remove the dist after every build.
What does your tsconfig.json look like?
0 configuration TypeScript support
I have no tsconfig. :smile:
I was trying out microbundle 0.12.0 this afternoon and happend to have a similar error, well actually multiple ones.
The demo repo can be found here: https://github.com/katywings/microbundle-test
To get errors you can run the one of the following "reproductions":
./scripts/build.js./scripts/build.js(yupp running the build twice results in an error)
./scripts/coverage.js./scripts/build.jsIt looks like microbundle is processing a lot of files/folders from the project root which it shouldnt even be targetting, like the coverage folder. Also microbundle saves the types in "dist/dist" instead of "dist" xD.
Downgrading to 0.11 "fixes" these problems.
@katywings Awesome, thanks a bunch for the reproduction case. With it I was able to quickly understand the issue and found a solution :+1: :100:
@marvinhagemeister Whoaaa! Youre insane, thanks so much for working out the fixes already!
W眉nsche dir f眉r morgen einen guten Wochenstart (:
@katywings Yeah, a repro case is worth its weight in gold :raised_hands:
Danke, das w眉nsche ich Dir auch! ;)
Thanks you both 馃憤
Most helpful comment
@marvinhagemeister Whoaaa! Youre insane, thanks so much for working out the fixes already!
W眉nsche dir f眉r morgen einen guten Wochenstart (: