content: [env]
  CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
  
  [config]
  skip_core_tasks = true
  
  [tasks.dev]
  workspace = false
  script = """
  cargo test
  cargo run --bin mogura
  """
  
  [tasks.wasm]
  env = { RUSTFLAGS = "--cfg web_sys_unstable_apis" }
  workspace = false
  script = '''
  trunk -V
  cd mogura-wasm
  trunk serve --open
  '''
  
  [tasks.wasm-release]
  env = { RUSTFLAGS = "--cfg web_sys_unstable_apis" }
  workspace = false
  script = '''
  trunk -V
  cd mogura-wasm
  trunk build --release
  WASM_FILE_NAME=$(ls dist/*.wasm)
  ls -lh dist
  wasm-opt -Os -o ${WASM_FILE_NAME} ${WASM_FILE_NAME}
  ls -lh dist
  '''
  
  [tasks.wasm-release-open]
  dependencies = ["wasm-release"]
  workspace = false
  env = { RUSTFLAGS = "--cfg web_sys_unstable_apis" }
  script = """
  trunk -V
  cd mogura-wasm
  trunk serve --release --open
  """
  
  [tasks.wasm-prepare]
  description = "for preparing wasm for github.io from local"
  workspace = false
  env = { WASM_TMP_DIR = "../../mogura-wasm-gh/", RUSTFLAGS = "--cfg web_sys_unstable_apis" }
  script = '''
  trunk -V
  cd mogura-wasm
  trunk build --release --public-url .
  WASM_FILE_NAME=$(ls dist/*.wasm)
  ls -lh dist
  wasm-opt -Os -o ${WASM_FILE_NAME} ${WASM_FILE_NAME}
  ls -lh dist
  rm -f $WASM_TMP_DIR/index.html
  rm -f $WASM_TMP_DIR/mogura-*.js
  rm -f $WASM_TMP_DIR/mogura-*.wasm
  cp -r ./dist/* $WASM_TMP_DIR
  sed -i -e "s/\/.\/mogura-/.\/mogura-/g" $WASM_TMP_DIR/index.html
  rm -f $WASM_TMP_DIR/index.html-e
  '''
  