npm install -g preact-clipreact create <app>cd <app>preact build --jsonstats.json using a Webpack stats analyzer (this one is from webpack-bundle-analyzer):
The preact library should only be included once in bundle.js.
It is included twice.
Ah I think this is caused by preact-cli including preact as a dependency now. I think we can fix this by using an absolute path to Preact in the aliases setup.
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:
preact$: resolve(__dirname, '../../node_modules/preact/dist/preact.min.js'),
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 $CWD/node_modules/preact and then maybe fall back to preact-cli's version. Otherwise that looks good, would love a PR.
Sure, will give that a try and see.
We should have the alias attempt to use preact from
$CWD/node_modules/preactand then maybe fall back to preact-cli's version
Is this fine?
preact$: isProd ? resolve(__dirname, '../../node_modules/preact/dist/preact.min.js') : 'preact',
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