Improve log trace for `Potential missing package.json files` warning
Environment
[email protected] React 18.2.0 unbuild 1.2.0
Reproduction
just run build
Describe the bug
When I run build, then give me this warnings
WARN Build is done with some warnings:
- Potential missing package.json files: dist/index.cjs ERROR Exiting with code (1). You can change this behavior by setting failOnWarn: false .
Additional context
No response
Logs
No response
How did you solve this?
I would like to know as well @gaogaoinvincible , since I am running into the same thing
Hey @BayBreezy and @gaogaoinvincible !
The issue is solved by setting the rollup.emitCJS option as true
// build.config.ts
import { defineBuildConfig } from "unbuild";
export default defineBuildConfig({
entries: ["./src/index"],
outDir: "dist",
declaration: true,
rollup: {
emitCJS: true
}
});
Oh, thanks @henryhale I just ended up ditching the package lol
I also encountered this issue and only found out after checking that there is a non-existent file path in package. json.😀😀
(reopeniung, since altohugh this is not a bug with unbuild, we might make error tracing better)
^3.0.0
import { defineBuildConfig } from "unbuild"
export default defineBuildConfig({
clean: true,
entries: ["./src/index"],
outDir: "dist",
rollup: {
+ inlineDependencies: true,
}
})
I'm still confused, there's no exactly way of solving this?