okonet / webpack-long-term-cache-demo

A demo config showing how to enable long-term caching using Webpack. Read [medium link] for details.
MIT License
97 stars 15 forks source link

Inlining JSON in to index.html #1

Closed felixakiragreen closed 9 years ago

felixakiragreen commented 9 years ago

In your article you say: This is easy as inlining the contents of the JSON in HTML. Our HTML head section should look like this:

I've spend several hours trying to figure this out and I'm still struggling. In this example http://clarkdave.net/2015/01/how-to-use-webpack-with-rails/#including-precompiled-assets-in-views ruby is used but I want to do it just with webpack.

Any help?

okonet commented 9 years ago

If you want to use static HTML, there is a static-site-generator-webpack-plugin for webpack: https://github.com/markdalgleish/static-site-generator-webpack-plugin

Or take a look at something like http://www.metalsmith.io/ or http://wintersmith.io/ or even grunt/gulp task.

felixakiragreen commented 9 years ago

Thanks. I found this which is working for me: https://github.com/ampedandwired/html-webpack-plugin