Skip to content

Commit

Permalink
Merge pull request #2359 from alphagov/application-script-module
Browse files Browse the repository at this point in the history
Defer prototype `application.js` to load after plugin scripts
  • Loading branch information
colinrotherham authored Oct 11, 2023
2 parents 17577bc + 28b2756 commit 67c8b7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [#2355: Prevent management pages using "plugin" GOV.UK Frontend views](https://github.com/alphagov/govuk-prototype-kit/pull/2355)
- [#2358: Suppress Sass warnings for `$legacy` deprecated colour palette](https://github.com/alphagov/govuk-prototype-kit/pull/2358)
- [#2359: Update application.js to `<script type"module">`](https://github.com/alphagov/govuk-prototype-kit/pull/2359)

## 13.13.4

Expand Down
5 changes: 4 additions & 1 deletion lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ marked.use({

const scripts = []
if (existsSync(path.join(projectDir, 'app', 'assets', 'javascripts', 'application.js'))) {
scripts.push('/public/javascripts/application.js')
scripts.push({
src: '/public/javascripts/application.js',
type: 'module'
})
}
if (plugins.legacyGovukFrontendFixesNeeded()) {
scripts.push('/plugin-assets/govuk-prototype-kit/lib/assets/javascripts/optional/legacy-govuk-frontend-init.js')
Expand Down

0 comments on commit 67c8b7f

Please sign in to comment.