MapComplete/scripts/fixPannellum.sh

9 lines
402 B
Bash
Executable file

#! /bin/bash
# Are you ready to feel really dirty?
# Pannellum is a direct import (not a module!) which uses window.pannellum = function...
# This breaks when importing this in nodeJS
# So, we patch it up...
echo "Fixing pannellum..."
sed -i 's/^window./if(typeof window !== "undefined")\n&/' "./node_modules/pannellum/build/pannellum.js"
cp ./node_modules/pannellum/build/pannellum.css ./public/css/