Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Target "node" output a static folder with bad exports #499

Closed
patricklafrance opened this issue Nov 29, 2024 · 4 comments · Fixed by #509
Closed

[Bug]: Target "node" output a static folder with bad exports #499

patricklafrance opened this issue Nov 29, 2024 · 4 comments · Fixed by #509
Assignees
Labels
🐞 bug Something isn't working

Comments

@patricklafrance
Copy link

patricklafrance commented Nov 29, 2024

Version

System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H
    Memory: 8.92 GB / 31.62 GB
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Details

I am using version 0.1.0 of Rslib.

When my config has target: "node", Rslib seems to output a static/assets/index.ts file. My project doesn't include any assets. The content of this static/assets/index.ts match the content of the src/index.ts file:

export * from "./defineConfig.ts";
export * from "./exports.ts";

Here's my Rslib config:

export default defineConfig({
    lib: [{
        format: "esm",
        syntax: "esnext",
        bundle: true,
        dts: {
            bundle: true
        }
    }],
    source: {
        entry: {
            index: "./src/index.ts",
            sharedDependenciesResolutionPlugin: "./src/sharedDependenciesResolutionPlugin.ts",
            nonCacheableRemoteEntryPlugin: "./src/nonCacheableRemoteEntryPlugin.ts"
        }
    },
    output: {
        target: "node",
        distPath: {
            root: "./dist"
        },
        cleanDistPath: true,
        minify: false
    },
    tools: {
        htmlPlugin: false
    }
});

Image

Image

Reproduce Steps

  • rslib build
@patricklafrance patricklafrance added the 🐞 bug Something isn't working label Nov 29, 2024
@Timeless0911
Copy link
Contributor

Can you provide a reproduction demo? This behaviour seems a bit strange.

@patricklafrance
Copy link
Author

Here's the repro: https://github.com/patricklafrance/rslib-issue-499-repro

@fi3ework fi3ework self-assigned this Dec 2, 2024
@fi3ework
Copy link
Member

fi3ework commented Dec 2, 2024

We'have inspected it's due to this PR of Rsbuild web-infra-dev/rsbuild#4011, which is not applicable for lib scenario. We'll make a quick fix.

@patricklafrance
Copy link
Author

Awesome thank you @fi3ework 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants