Add GOV.UK Frontend JS

This includes the JS for all GOV.UK Frontend code.
If our frontend build includes a module bundler in
future, we should only include the JS for the
components we use, as with our Sass.
This commit is contained in:
Tom Byers
2019-10-10 16:16:51 +01:00
parent f26ea5b3d8
commit 223f4a1ff3
2 changed files with 4 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
window.GOVUKFrontend.initAll();
$(() => $("time.timeago").timeago());
$(() => GOVUK.stickAtTopWhenScrolling.init());

View File

@@ -114,7 +114,8 @@ const javascripts = () => {
paths.npm + 'query-command-supported/dist/queryCommandSupported.min.js',
paths.npm + 'diff-dom/diffDOM.js',
paths.npm + 'timeago/jquery.timeago.js',
paths.npm + 'textarea-caret/index.js'
paths.npm + 'textarea-caret/index.js',
paths.govuk_frontend + 'all.js'
]))
.pipe(plugins.uglify())
.pipe(plugins.concat('all.js'))