Modernize frontend build pipeline with esbuild and ES modules
This commit is contained in:
@@ -18,7 +18,7 @@ const EXPECTED_SHA1 = {
|
||||
const FIRMWARE_PATH = process.env.FIRMWARE_ZIP
|
||||
|| path.resolve(__dirname, '..', '..', 'kobopatch-wasm', 'testdata', 'kobo-update-4.45.23646.zip');
|
||||
|
||||
const WEBROOT = path.resolve(__dirname, '..', '..', 'web', 'public');
|
||||
const WEBROOT = path.resolve(__dirname, '..', '..', 'web', 'dist');
|
||||
const WEBROOT_FIRMWARE = path.join(WEBROOT, '_test_firmware.zip');
|
||||
|
||||
// SHA1 of the original unmodified KoboRoot.tgz inside firmware 4.45.23646.
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = defineConfig({
|
||||
},
|
||||
},
|
||||
webServer: {
|
||||
command: 'python3 -m http.server -d ../../web/public 8889',
|
||||
command: 'cd ../../kobopatch-wasm && bash build.sh && cd ../web && node build.mjs && python3 -m http.server -d dist 8889',
|
||||
port: 8889,
|
||||
reuseExistingServer: true,
|
||||
},
|
||||
|
||||
@@ -12,7 +12,7 @@ set -euo pipefail
|
||||
# Prerequisites:
|
||||
# - kobopatch.wasm built (run kobopatch-wasm/build.sh first)
|
||||
# - Firmware zip cached at kobopatch-wasm/testdata/ (downloaded automatically)
|
||||
# - NickelMenu assets in web/public/nickelmenu/ (set up automatically)
|
||||
# - NickelMenu assets in web/src/nickelmenu/ (set up automatically)
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
@@ -46,13 +46,13 @@ FIRMWARE_DIR="../../kobopatch-wasm/testdata"
|
||||
FIRMWARE_FILE="${FIRMWARE_DIR}/kobo-update-${FIRMWARE_VERSION}.zip"
|
||||
|
||||
# Check WASM is built.
|
||||
if [ ! -f "../../web/public/wasm/kobopatch.wasm" ]; then
|
||||
if [ ! -f "../../web/dist/wasm/kobopatch.wasm" ]; then
|
||||
echo "ERROR: kobopatch.wasm not found. Run kobopatch-wasm/build.sh first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set up NickelMenu assets if not present.
|
||||
NM_DIR="../../web/public/nickelmenu"
|
||||
NM_DIR="../../web/src/nickelmenu"
|
||||
if [ ! -f "$NM_DIR/NickelMenu.zip" ] || [ ! -f "$NM_DIR/kobo-config.zip" ]; then
|
||||
echo "Setting up NickelMenu assets..."
|
||||
../../nickelmenu/setup.sh
|
||||
|
||||
Reference in New Issue
Block a user