summaryrefslogtreecommitdiff
path: root/client/build.js
diff options
context:
space:
mode:
authorShyam Sunder <sgsunder1@gmail.com>2018-07-24 19:53:29 -0400
committerMarcin Kurczewski <rr-@sakuya.pl>2018-08-23 21:04:19 +0200
commit565027269c124c2aa7f7045983a75a31a9242215 (patch)
treeba69161a237830936f4c9121becaacc9ee8f7f60 /client/build.js
parentdefada45ab5efc7f9a0c209f364f0864d297514a (diff)
client/js/router.js: Reads <base> href tag
Diffstat (limited to 'client/build.js')
-rw-r--r--client/build.js5
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';