Closed ShaneYu closed 2 weeks ago
Can you upgrade @rslib/core
to 0.0.4
, I think the two issues have been solved.
@Timeless0911 Thank you, I can confirm that upgrading to 0.0.4
has indeed resolved both issues. 😁
❤️ Thank you! 😄 Loving rslib so much! 😉
Version
Details
There are currently two issues I am facing with Rslib at this time.
Rsbuild is meant to be able to automatically find the entry point via
src/index.ts
and a load of other file extensions, according to the error I get. Issue is that when using Rslib without specifying asource.entry
in the config, it cannot locate the entrysrc/index.ts
file that I have.This results in the following error:
Entry config added to make it work:
Adding in the
source.entry
config resolves the above issue, then the second issue is that the ESM format output does not look correct. It only outputs*.d.mts
file and no actual*.mjs
files are created; this means that only type definitions exist and no actual code. Whereas the CJS format is correctly output*.js
code files and also the*.d.ts
type definition files.Reproduce link
https://github.com/ShaneYu/rslib-esm-issue
Reproduce Steps
To replicate these issues I have created a temp GitHub repository that can be cloned down and played with.
For the second issue regarding ESM format output being incorrect:
git clone git@github.com:ShaneYu/rslib-esm-issue.git
pnpm install
pnpm build
Now go and look at the output files under
./dist/esm
you will notice that no*.mjs
code files have been created, however the*.mts
type definition files have been. The CJS output on the other hand, this has the expected code files and type definitions.For the first issue regarding the entry point configuration:
Skip steps 1 and 2 if done previously.
Clone the repository with
git clone git@github.com:ShaneYu/rslib-esm-issue.git
Install the dependencies with
pnpm install
Edit the
rslib.config.ts
file to remove thesource.entry
config from both ESM and CJS lib configsRun a build with
pnpm build
Notice that despite having a
src/index.ts
file, it results in an error and states that the entry file cannot be found.