Update template generation (#224)

* Bump do-vue & do-bulma

* Tweak how we generate the template

* Remove the document.write monkeypatch, we'll fix this in prod
This commit is contained in:
Matt (IPv4) Cowley
2021-02-19 17:56:38 +00:00
committed by GitHub
parent 4a786d2bfd
commit 4cfdcdb8d1
2 changed files with 119 additions and 91 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 DigitalOcean
Copyright 2021 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
@@ -32,8 +32,14 @@ const main = () => {
const buildDir = path.join(__dirname, '..', '..', '..', 'build');
let template = fs.readFileSync(path.join(buildDir, 'base.html'), 'utf8');
template = template.replace('<block name="title"></block>', 'NGINXConfig | ');
// Inject our title now
template = template.replace('<block name="title"><title>DigitalOcean</title></block>', '<title>NGINXConfig | DigitalOcean</title>');
// We don't need the head/script blocks, vue-cli-service handles those
template = template.replace('<block name="head"></block>', '');
template = template.replace('<block name="script"></block>', '');
// Inject our app mounting point
template = template.replace('<block name="content"></block>', '<div id="app"></div>');
fs.writeFileSync(path.join(buildDir, 'index.html'), template);