diff options
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/challenger-ui/build.mjs | 40 | ||||
-rwxr-xr-x | packages/challenger-ui/create_must.sh | 15 | ||||
-rw-r--r-- | packages/challenger-ui/package.json | 4 |
3 files changed, 57 insertions, 2 deletions
diff --git a/packages/challenger-ui/build.mjs b/packages/challenger-ui/build.mjs new file mode 100755 index 000000000..548afe2e4 --- /dev/null +++ b/packages/challenger-ui/build.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/* + This file is part of GNU Taler + (C) 2022 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + +import { build } from "@gnu-taler/web-util/build"; + +await build({ + type: "production", + source: { + js: ["src/main.js"], + assets: [{ + base: "src", + files: [ + "src/attempts-exhausted.html", + "src/enter-address-form.html", + "src/enter-tan-form.html", + "src/internal-error.html", + "src/invalid-pin.html", + "src/invalid-request.html", + "src/validation-unknown.html", + ] + }], + }, + destination: "./dist/prod", + css: "postcss", +}); + diff --git a/packages/challenger-ui/create_must.sh b/packages/challenger-ui/create_must.sh new file mode 100755 index 000000000..6a6c71719 --- /dev/null +++ b/packages/challenger-ui/create_must.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cd dist/prod +for file in *.html; do + + #remove the js reference used for dev + sed /main.js/d -i $file + + #rename the extension to must template + mv $file ${file:0:-5}.must +done + +#delete unsued files +rm main.js main.js.map main.css.map + diff --git a/packages/challenger-ui/package.json b/packages/challenger-ui/package.json index bfac108a7..e797b12db 100644 --- a/packages/challenger-ui/package.json +++ b/packages/challenger-ui/package.json @@ -7,7 +7,7 @@ "description": "UI for GNU Challenger.", "type": "module", "scripts": { - "build": "./build.mjs", + "build": "./build.mjs && ./create_must.sh", "check": "tsc", "clean": "rm -rf dist lib", "i18n:extract": "pogen extract", @@ -45,4 +45,4 @@ "pogen": { "domain": "aml-backoffice" } -}
\ No newline at end of file +} |