-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Production build includes two copies of preact? #126
Comments
Ah I think this is caused by Curious if @lukeed or @thangngoc89 see any issues in doing that. |
@developit Should be no issue since webpack handles everything (internally) with absolute paths anyway. |
Would love a PR for this btw if anyone has a few minutes. Otherwise I'll try to get around to it whenever I can. |
I have given this a shot and it worked for me: Is there a better way to do this? I am attaching the JSON file which I got while testing. Please find the screenshot of the webpack bundle analyzer, stats.json file: stats.json.zip @developit @lukeed any suggestions? If this is fine, I would be happy to submit a PR. |
We should have the alias attempt to use preact from |
Sure, will give that a try and see.
|
Is this fine?
|
How about: preact$: isProd ? resolve(env.cwd, 'node_modules/preact/dist/preact.min.js') : 'preact' |
Cool, I did the same thing after I commented 😅 |
@developit @lukeed please have a look at it. Yaaay, bundle size reduced from 26.8kb to 18.9kb. |
@lukeed it failed 8 tests !! not sure why? Can you please have a look at the log? https://paste.fedoraproject.org/paste/~djRyBcRUltRzRRaON3~qg |
Steps to reproduce:
npm install -g preact-cli
preact create <app>
cd <app>
preact build --json
stats.json
using a Webpack stats analyzer (this one is fromwebpack-bundle-analyzer
):Expected behavior:
The preact library should only be included once in
bundle.js
.Actual behavior:
It is included twice.
The text was updated successfully, but these errors were encountered: