Skip to content

Commit

Permalink
Import iframeResizer.contentWindow.js from example bundle
Browse files Browse the repository at this point in the history
The npm package `iframe-resizer` has deleted the pre-minified `iframeResizer.contentWindow.min.js` file from their published files

See: davidjbradshaw/iframe-resizer#1195 (comment)
  • Loading branch information
colinrotherham committed Nov 16, 2023
1 parent 185f8cd commit 92eb212
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 11 deletions.
5 changes: 0 additions & 5 deletions lib/metalsmith.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ module.exports = metalsmith
copyAssets('{fonts,images}/*', {
cwd: join(dirname(require.resolve('govuk-frontend')), 'assets'),
dest: 'assets'
}),

copyAssets('**/iframeResizer.contentWindow.@(map|min.js)', {
cwd: join(dirname(require.resolve('iframe-resizer')), 'js'),
dest: 'javascripts/vendor'
})
])

Expand Down
2 changes: 2 additions & 0 deletions src/javascripts/components/example-page.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'iframe-resizer/js/iframeResizer.contentWindow.js'

function ExamplePage($module) {
this.$module = $module
}
Expand Down
1 change: 0 additions & 1 deletion src/styles/page-template/block-areas/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,5 @@ stylesheets:
{{ super() }}
{# Since we’re not extending the Design System layout we need to add this manually #}
<script src="{{ getFingerprint('javascripts/application-example.js') }}"></script>
<script src="{{ getFingerprint('javascripts/vendor/iframeResizer.contentWindow.min.js') }}"></script>
</div>
{%- endblock %}
1 change: 0 additions & 1 deletion src/styles/page-template/custom/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,4 @@ ignoreInSitemap: true

{% block bodyEnd %}
<script src="{{ getFingerprint('javascripts/application-example.js') }}"></script>
<script src="{{ getFingerprint('javascripts/vendor/iframeResizer.contentWindow.min.js') }}"></script>
{% endblock %}
1 change: 0 additions & 1 deletion src/styles/page-template/default/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ layout: false

{% block bodyEnd %}
<script src="{{ getFingerprint('javascripts/application-example.js') }}"></script>
<script src="{{ getFingerprint('javascripts/vendor/iframeResizer.contentWindow.min.js') }}"></script>
{% endblock %}
1 change: 0 additions & 1 deletion views/layouts/layout-example-full-page-govuk.njk
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@
{% endblock %}
{% block bodyEnd %}
<script src="{{ getFingerprint('javascripts/application-example.js') }}"></script>
<script src="{{ getFingerprint('javascripts/vendor/iframeResizer.contentWindow.min.js') }}"></script>
{% endblock %}
1 change: 0 additions & 1 deletion views/layouts/layout-example-full-page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@
{% endblock %}
{% block bodyEnd %}
<script src="{{ getFingerprint('javascripts/application-example.js') }}"></script>
<script src="{{ getFingerprint('javascripts/vendor/iframeResizer.contentWindow.min.js') }}"></script>
{% endblock %}
1 change: 0 additions & 1 deletion views/layouts/layout-example.njk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

{% block bodyEnd %}
<script src="{{ getFingerprint('javascripts/application-example.js') }}"></script>
<script src="{{ getFingerprint('javascripts/vendor/iframeResizer.contentWindow.min.js') }}"></script>
{% endblock %}

{# Example pages shouldn't have a footer, so blank the one provided by the template #}
Expand Down

0 comments on commit 92eb212

Please sign in to comment.