How to build preact in one index.html file?
See original GitHub issueHey. I use preact to create interactive pages that are hosted in the memory of the microcontroller. The preact size and features are really impressive, but for my use case it is still overloaded.
What can I do so that when I run the npm run build command, I get 1 file - index.html, where will all the styles and scripts be inside?
I used to have a working version, but when updating webpack and preact, it turned out to be not working:
package.json
"build": "preact build --no-prerender --no-service-worker"
preact.config.js
export default (config, env, helpers) => {
const chunks = helpers.getPluginsByName(config, 'CommonsChunkPlugin')[0]
config.plugins[chunks.index].minChunks = 1
}
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:28 (12 by maintainers)
Top Results From Across the Web
Getting Started | Preact: Fast 3kb React alternative with the ...
For most templates, the best place to start is src/index.js or src/components/app/index.js . Production builds. The npm run build command compiles a production ......
Read more >Preact CLI How To Access Index Page - Stack Overflow
I have created an app using the preact- ...
Read more >Building a Form with Preact | www.thecodebarbarian.com
First, let's set up a basic index.html file that will serve as the entry point for the app. <html> <head> <title>Preact Test</title> </head> ......
Read more >Getting Started - Vite
A build command that bundles your code with Rollup, pre-configured to output ... One thing you may have noticed is that in a...
Read more >Embeddable Web Applications with Shadow DOM - Viget
Let's build an embeddable Preact web app using the Shadow DOM. ... a src directory and a few files: index.html , index.tsx ,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I made this but it was not so easy as a one liner
https://gist.github.com/sebasjm/087df4b0b0a611ce409fe30a67a1d0d9
Any improvement would be greatly appreciated.
Hey @BRAGA96 did you end up making any progress with this? I am in the exact situation using a microcontroller, and am also interested in condensing the build files into a single html file