From 3d85e097f638c874ac980d55cd06ad12fd2f7e44 Mon Sep 17 00:00:00 2001 From: Kushan Joshi <0o3ko0@gmail.com> Date: Wed, 23 Jan 2019 23:28:33 +0530 Subject: [PATCH] Add htmlSource injection --- CHANGELOG.md | 4 ++ README.md | 41 +++++++++++++++++--- examples/fancy/public/blink.css | 11 ++++++ examples/fancy/src/app.js | 3 ++ examples/fancy/underreact.config.js | 3 +- lib/config/validate-config.js | 2 +- lib/webpack-config/generate-html-template.js | 8 +++- 7 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 examples/fancy/public/blink.css diff --git a/CHANGELOG.md b/CHANGELOG.md index bbc6caf..15b170e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## HEAD + +- Allow for base path injection in `htmlSource`. + ## 0.4.0 - **Bug:**: Fixes the way Underreact handles root relative urls. diff --git a/README.md b/README.md index 50ee594..3f97b34 100644 --- a/README.md +++ b/README.md @@ -200,26 +200,55 @@ Underreact is intended for single-page apps, so you only need one HTML page. If You have 2 choices: -1. **Preferred:** Provide the [`htmlSource`] configuration option, which is an HTML string or a Promise that resolves to an HTML string. +1. **Preferred:** Provide the [`htmlSource`] configuration option, which is an HTML string, a Promise or a Function returning HTML string or promise, that resolves to an HTML string. 2. Provide no HTML-rendering function and let Underreact use the default, development-only HTML document. *You should only do this for prototyping and early development*: for production projects, you'll definitely want to define your own HTML, if only for the `