Blame SOURCES/build_frontend.sh

5bde66
#!/bin/bash -eu
5bde66
625261
# Webpack needs more than the default 4GB RAM
625261
export NODE_OPTIONS="${NODE_OPTIONS:-} --max_old_space_size=6144"
625261
5bde66
# Build the frontend
5bde66
yarn run build
5bde66
5bde66
# Build the bundled plugins
5bde66
mkdir plugins-bundled/external
5bde66
yarn run plugins:build-bundled
5bde66
for plugin in plugins-bundled/internal/input-datasource; do
5bde66
  mv $plugin $plugin.tmp
5bde66
  mv $plugin.tmp/dist $plugin
5bde66
  rm -rf $plugin.tmp
5bde66
done
5bde66
rm plugins-bundled/README.md plugins-bundled/.gitignore plugins-bundled/external.json
5bde66
5bde66
# Fix permissions (webpack sometimes outputs files with mode = 666 due to reasons unknown (race condition/umask issue afaics))
5bde66
chmod -R g-w,o-w public/build plugins-bundled