unbuild
unbuild copied to clipboard
Outdir beign ignored after v2 upgrade
Environment
OS: Ubuntu 22.04 Node Version: 18.17.1 Package Manager: pnpm@8 Additional Environment: Enterprise GitHub Actions runner ubuntu-latest
Unbuild Versions :
- Bug Found on: v 2.0.0
- Last Working on: v 1.2.1
Reproduction
Due to the package is enterprise locked, I can only share the raw steps using the screenshots provided on the bug description.
- Gen a base project using unbuild v.1.2.1 (see the screenshots for config details) (The project must contain the entry on a subpath for the source ex on the screenshots: src/proxies/index)
- Run build and save the dist folder structure
- Update unbuild to v2.0.0
- Run build and compare previous build structure 4.1. Change the outdir (the global one, the entry one or both) and specify a different path 4.2. CRun build and compare dist layout with other two
Describe the bug
Using this standard configuration:
and this package.json layout:
the out passed from being this (Using unbuild v1.2.1):
to this one (Using unbuild v2.0.0):
after update, i tried to force the out dir using this config:
still unbuild dont generate the correct dist layout, some way coupling to the entries structure even using rollup and not mkdist.
Additional context
No response
Logs
Success with v1.2.1:
> unbuild
[info] Building @siigo-arquitectura/button-atom-react
[success] Build succeeded for button-atom-react
[log] dist/index.cjs (total size: 3.08 kB, chunk size: 3.08 kB, exports: ButtonAtom)
[log] dist/index.mjs (total size: 2.56 kB, chunk size: 2.56 kB, exports: ButtonAtom)
Σ Total dist size (byte size): 6.07 kB
[log]
Failed:
> unbuild
[info] Building button-atom-react
[info] Cleaning dist directory: `./dist`
[success] Build succeeded for button-atom-react
[log] dist/proxies/index.cjs (total size: 3.28 kB, chunk size: 3.28 kB, exports: ButtonAtom)
[log] dist/proxies/index.mjs (total size: 2.75 kB, chunk size: 2.75 kB, exports: ButtonAtom)
Σ Total dist size (byte size): 7.35 kB
[log]
[warn] Build is done with some warnings:
- Potential missing package.json files: dist/index.cjs, dist/index.mjs, dist/index.d.ts
Error: Exiting with code (1). You can change this behavior by setting `failOnWarn: false` .
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.