#!/usr/bin/env bash

PWD=$(dirname $(realpath "$0"))
DIR=$(realpath $PWD/../..)

export NODE_PATH="$DIR/node_modules:$NODE_PATH"

if [ $1 ];then
filepath=$(realpath $1)
fi

exec node --trace-uncaught \
  --expose-gc \
  --loader "@w5/loader" \
  --unhandled-rejections=strict $filepath ${@:2:$#}
