Browse Source

Make it possible to self-build Element on low-memory devices (<4G RAM)

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1357
pull/1366/head
Slavi Pantaleev 4 years ago
parent
commit
c8a8035de4
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      roles/matrix-client-element/tasks/setup_install.yml

+ 14
- 0
roles/matrix-client-element/tasks/setup_install.yml View File

@@ -29,6 +29,20 @@
register: matrix_client_element_git_pull_results register: matrix_client_element_git_pull_results
when: "matrix_client_element_container_image_self_build|bool" when: "matrix_client_element_container_image_self_build|bool"


# See:
# - https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1357
# - https://github.com/vector-im/element-web/issues/19544
- name: Patch webpack.config.js to support building on low-memory (<4G RAM) devices
lineinfile:
path: "{{ matrix_client_element_docker_src_files_path }}/webpack.config.js"
regexp: '(\s+)splitChunks: \{'
line: '\1splitChunks: { maxSize: 100000,'
backrefs: yes
owner: root
group: root
mode: '0644'
when: "matrix_client_element_container_image_self_build|bool and ansible_memtotal_mb < 4096"

- name: Ensure Element Docker image is built - name: Ensure Element Docker image is built
docker_image: docker_image:
name: "{{ matrix_client_element_docker_image }}" name: "{{ matrix_client_element_docker_image }}"


Loading…
Cancel
Save