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

React output target not tree shaking #184

Closed
Arvind6353 opened this issue Sep 15, 2021 · 2 comments
Closed

React output target not tree shaking #184

Arvind6353 opened this issue Sep 15, 2021 · 2 comments

Comments

@Arvind6353
Copy link

Arvind6353 commented Sep 15, 2021

Current Behavior
Hi Team,

I am trying to use framework binding with react.

I used the below config and create a bundle and imported it in a react app as below
reactOutputTarget({
componentCorePackage: 'fw-design-core',
proxiesFile: '../react/src/components.ts',
//loaderDir: 'dist/loader',
includeDefineCustomElements: true,
}),

**import { FwButton } from "fw-design-react";

{/* /} console.log("event triggerd")} >Primary button
);
*
The webcomponent lib holds 2 components my-component and fw-button.

Am using only fw-button in the code. When I run npm run build (create-react-app).

I am seeing many chunk files generated and one of the chunk file related to "my-component" though this is not being used .

Expected Behavior
I assume ideally with tree shaking the above chunk file should not be generated since "my-component" is not being used.

Can you please help with this ?

Code Reproduction URL
https://github.com/Arvind6353/react-wc/blob/master/src/App.js#L4

@sean-perkins
Copy link
Collaborator

Thanks for opening this issue! I am going to combine this with: #255 as the fix will apply to both of these issues. Thanks!

@ionitron-bot
Copy link

ionitron-bot bot commented May 26, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the output targets, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants