---
- name: Compile js bundle locally
  command: node ../node_modules/webpack/bin/webpack.js -vpc --config ../webpack.config.prod.js
  delegate_to: 127.0.0.1
  become: no

- name: Deploy html
  copy:
    src: ../../index.html
    dest: /var/www/{{ domain_name }}/

- name: Deploy js bundle
  copy:
    src: ../../dist/bundle.js
    dest: /var/www/{{ domain_name }}/

---
- name: Compile js bundle locally
  command: yarn pre
  args:
    chdir: ..
  delegate_to: 127.0.0.1
  become: no
  tags: [compile]

- name: Deploy html
  copy:
    src: ../../index.html
    dest: /var/www/{{ domain_name }}/

- name: Deploy js bundle
  copy:
    src: ../../dist/bundle.js
    dest: /var/www/{{ domain_name }}/

Use yarn task to build prod bundle.
Use yarn task to build prod bundle.
