- name: Clone ChunkViz
  git:
    repo: "https://github.com/gkamradt/ChunkViz"
    dest: "{{ courseware_repos_dir }}/ChunkViz"
    version: "{{ courseware_chunkviz_commit }}"
    update: false

- name: Install ChunkViz dependencies
  command: npm install
  args:
    chdir: "{{ courseware_repos_dir }}/ChunkViz"
    creates: "{{ courseware_repos_dir }}/ChunkViz/node_modules"

- name: Build ChunkViz
  command: npm run build
  args:
    chdir: "{{ courseware_repos_dir }}/ChunkViz"
    creates: "{{ courseware_repos_dir }}/ChunkViz/build/index.html"

