Przeglądaj źródła

fix: update integrity attributes for preview environment and include preview directory in build inputs

codecalm 4 miesięcy temu
rodzic
commit
baa6056c4c
3 zmienionych plików z 5 dodań i 4 usunięć
  1. 2 2
      shared/includes/layout/js.html
  2. 1 1
      shared/layouts/base.html
  3. 2 1
      turbo.json

+ 2 - 2
shared/includes/layout/js.html

@@ -6,10 +6,10 @@
 {% include "layout/js-libs.html" libs=libs.js %}
 
 <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
-<script src="{{ page | relative }}/dist/js/tabler{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" defer{% if environment != 'development' %} integrity="{{ sri.js }}"{% endif %}></script>
+<script src="{{ page | relative }}/dist/js/tabler{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" defer{% if environment == 'preview' %} integrity="{{ sri.js }}"{% endif %}></script>
 <!-- END GLOBAL MANDATORY SCRIPTS -->
 
 <!-- BEGIN DEMO SCRIPTS -->
-<script src="{{ page | relative }}/preview/js/demo{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" defer{% if environment != 'development' %} integrity="{{ sri.demo-js }}"{% endif %}></script>
+<script src="{{ page | relative }}/preview/js/demo{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" defer{% if environment == 'preview' %} integrity="{{ sri.demo-js }}"{% endif %}></script>
 <!-- END DEMO SCRIPTS -->
 {% scripts %}

+ 1 - 1
shared/layouts/base.html

@@ -43,7 +43,7 @@
 {% assign layout-dark = layout-dark | default: site.layoutDark %}
 <body{% if layout.body-class or body-class %} class="{% if layout.body-class %} {{ layout.body-class }}{% endif %}{% if body-class %} {{ body-class }}{% endif %}"{% endif %}>
 	<!-- BEGIN GLOBAL THEME SCRIPT -->
-	<script src="{{ page | relative }}/dist/js/tabler-theme{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}"{% if environment != 'development' %} integrity="{{ sri.js-theme }}"{% endif %}></script>
+	<script src="{{ page | relative }}/dist/js/tabler-theme{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}"{% if environment == 'preview' %} integrity="{{ sri.js-theme }}"{% endif %}></script>
 	<!-- END GLOBAL THEME SCRIPT -->
 
 	{{ content }}

+ 2 - 1
turbo.json

@@ -9,7 +9,8 @@
         "^build"
       ],
       "inputs": [
-        "shared/**"
+        "shared/**",
+        "preview/**"
       ],
       "outputs": [
         "dist/**"