Skip to content

Commit

Permalink
Compensate for missing trailing semicolon
Browse files Browse the repository at this point in the history
The govuk_frontend_toolkit stuff uses different javascript
formatting than us where they begin their files with
semicolons but don't end files with them.

Our JS does the opposite, and so concatenating the files
results in a compilation bug somewhere in the middle.

I've also changed the way everything is imported
to more closely resemble the way the imports work in the
buyer app.
  • Loading branch information
pcraig3 committed Feb 22, 2017
1 parent f4004f4 commit d8eca1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/assets/javascripts/_analytics.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//= include ../../../node_modules/govuk_frontend_toolkit/javascripts/govuk/analytics/google-analytics-universal-tracker.js
//= include ../../../node_modules/govuk_frontend_toolkit/javascripts/govuk/analytics/analytics.js

; // JavaScript in the govuk_frontend_toolkit doesn't have trailing semicolons

//= include analytics/_register.js
//= include analytics/_pageViews.js
//= include analytics/_events.js
Expand Down
4 changes: 1 addition & 3 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
Sprockets-style (https://github.com/sstephenson/sprockets)
directives to concatenate multiple Javascript files into one.
*/
//= include ../../../node_modules/govuk_frontend_toolkit/javascripts/govuk/analytics/analytics.js
//= include ../../../node_modules/govuk_frontend_toolkit/javascripts/govuk/analytics/google-analytics-universal-tracker.js
//= include ../../../node_modules/govuk_frontend_toolkit/javascripts/vendor/polyfills/bind.js
//= include ../../../bower_components/jquery/dist/jquery.js
//= include ../../../bower_components/hogan/web/builds/3.0.2/hogan-3.0.2.js
Expand All @@ -14,8 +12,8 @@
//= include ../../../bower_components/digitalmarketplace-frontend-toolkit/toolkit/javascripts/validation.js
//= include ../../../node_modules/govuk_frontend_toolkit/javascripts/govuk/selection-buttons.js
//= include ../../../node_modules/govuk_frontend_toolkit/javascripts/govuk/show-hide-content.js
//= include _selection-buttons.js
//= include _analytics.js
//= include _selection-buttons.js

(function(GOVUK, GDM) {

Expand Down

0 comments on commit d8eca1b

Please sign in to comment.