Skip to content

Commit

Permalink
fix: wire up sourcemaps for vendor JS libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
ngurenyaga committed Jul 15, 2021
1 parent 44d3921 commit d574261
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ function scripts() {
// Vendor Javascript minification
function vendorScripts() {
return src(paths.vendorsJs)
.pipe(sourcemaps.init())
.pipe(concat("vendors.js"))
.pipe(lec({ verbose: true, eolc: "LF", encoding: "utf8" }))
.pipe(dest(paths.js))
.pipe(plumber()) // Checks for errors
.pipe(uglify()) // Minifies the js
.pipe(rename({ suffix: ".min" }))
.pipe(sourcemaps.write())
.pipe(dest(paths.js));
}

Expand Down
1 change: 1 addition & 0 deletions pepfar_mle/static/js/vendors.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pepfar_mle/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<link href="{% static 'css/sb-admin-2.min.css' %}" rel="stylesheet"> {% endcompress %} {% endblock %}
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet"> {# Placed at the top of the document so pages load faster with defer #} {% block javascript %}
<!-- Vendor dependencies bundled as one file-->{% compress js %}

<script defer src="{% static 'js/vendors.js' %}"></script>{% endcompress %}
<script defer src="{% static 'js/vendors.min.js' %}"></script>
<script defer src="{% static 'js/sb-admin-2.min.js' %}"></script>{% endcompress %}
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WW2W29ZMTZ"></script>
<script src="https://kit.fontawesome.com/e1c9d8c99d.js" crossorigin="anonymous"></script>

Expand All @@ -46,7 +46,7 @@
<div class="sidebar-brand-icon rotate-n-15">
<i class="fas fa-laugh-wink"></i>
</div>
<div class="sidebar-brand-text mx-3">SB Admin <sup>2</sup></div>
<div class="sidebar-brand-text mx-3">Program Database</div>
</a>

<!-- Divider -->
Expand Down

0 comments on commit d574261

Please sign in to comment.