Skip to content
Snippets Groups Projects
Commit 82c10934 authored by rhenck's avatar rhenck
Browse files

Add dynamic version string to build process

The version is taken from the package.json file and replaced in the 
html.
parent 4aa4a862
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
<title>Verona Editor Aspect</title>
<meta name="application-name" content="iqb-editor-aspect"
data-version="0.1.0"
data-version="version-placeholder"
data-api-version="2.0.0"
data-repository-url="https://github.com/iqb-berlin/verona-modules-apect"
data-supported-unit-definition-types="iqb-aspect-module@0.0.1"/>
......@@ -30,7 +30,7 @@
"de": "TODO",
"en": "TODO"
},
"version": "0.1.0",
"version": "version-placeholder",
"apiVersion": "2.0",
"repository": {
"type": "git",
......
......@@ -5,7 +5,7 @@
<title>Verona Player Aspect</title>
<meta name="application-name" content="iqb-player-aspect"
data-version="0.1.0"
data-version="version-placeholder"
data-repository-url="https://github.com/iqb-berlin/verona-modules-apect"
data-api-version="3.0.0"
data-not-supported-api-features=""
......@@ -34,7 +34,7 @@
"de": "TODO",
"en": "TODO"
},
"version": "0.1.0",
"version": "version-placeholder",
"apiVersion": "3.0.0",
"repository": {
"type": "git",
......
......@@ -10,7 +10,8 @@ const wrapperPath = process.argv[4];
childProcess.fork('node_modules/iqb-dev-components/src/js_css_packer.js',
['dist', packageName, 'dist']);
const fileContent = fs.readFileSync(wrapperPath, 'utf8').toString();
const fileContent = fs.readFileSync(wrapperPath, 'utf8').toString()
.replace(/version-placeholder/g, packageVersion);
fs.writeFileSync('dist/index.html', fileContent, 'utf8');
const targetFileName = `verona-${packageName}-aspect-${packageVersion}.html`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment