diff options
| author | Shyam Sunder <sgsunder1@gmail.com> | 2018-07-24 19:53:29 -0400 |
|---|---|---|
| committer | Marcin Kurczewski <rr-@sakuya.pl> | 2018-08-23 21:04:19 +0200 |
| commit | 565027269c124c2aa7f7045983a75a31a9242215 (patch) | |
| tree | ba69161a237830936f4c9121becaacc9ee8f7f60 /client/build.js | |
| parent | defada45ab5efc7f9a0c209f364f0864d297514a (diff) | |
client/js/router.js: Reads <base> href tag
Diffstat (limited to 'client/build.js')
| -rw-r--r-- | client/build.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/client/build.js b/client/build.js index 23d54fa..fdc5fd0 100644 --- a/client/build.js +++ b/client/build.js @@ -65,7 +65,10 @@ function bundleHtml() { const underscore = require('underscore'); const babelify = require('babelify'); const baseHtml = readTextFile('./html/index.htm', 'utf-8'); - writeFile('./public/index.htm', minifyHtml(baseHtml)); + const baseUrl = process.env.BASE_URL ? process.env.BASE_URL : '/'; + const finalHtml = baseHtml.replace( + '<!-- Base HTML Placeholder -->', `<base href="${baseUrl}"/>`); + writeFile('./public/index.htm', minifyHtml(finalHtml)); glob('./html/**/*.tpl', {}, (er, files) => { let compiledTemplateJs = '\'use strict\'\n'; |