alphagov / govuk-prototype-kit

Rapidly create HTML prototypes of GOV.UK services
https://prototype-kit.service.gov.uk
MIT License
301 stars 236 forks source link

Defer prototype `application.js` to load after plugin scripts #2359

Closed colinrotherham closed 11 months ago

colinrotherham commented 11 months ago

This PR switches application.js to <script type"module"> to fix:

This change defers script load by default and also ensures:

  1. ES module import { Accordion } from syntax support in GOV.UK Frontend v5
  2. Load order compatibility with other plugins that update to ES modules

Browser support

This follows GOV.UK Frontend to protect browsers without ES6 modules support from script errors, such as:

colinrotherham commented 11 months ago

Moved the CHANGELOG entry into Unreleased