DEV: Update asset config for embroider (#23461)

- Add data-embroider-ignore to all script tags which are not currently being compiled by embroider

- Ensure all remaining script tags are wrapped in `<discourse-chunked-script>` so that Rails will follow any renames which Embroider makes (e.g. when it adds fingerprints to filenames)
This commit is contained in:
David Taylor 2023-09-07 16:17:22 +01:00 committed by GitHub
parent cde5dea74f
commit 894307ff0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -21,7 +21,9 @@
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css" />
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/discourse.css" />
<discourse-chunked-script entrypoint="vendor">
<script defer src="{{rootURL}}assets/vendor.js"></script>
</discourse-chunked-script>
<discourse-chunked-script entrypoint="discourse">
<ember-auto-import-scripts defer entrypoint="app"></ember-auto-import-scripts>
@ -51,7 +53,7 @@
<bootstrap-content key="hidden-login-form"></bootstrap-content>
<script defer src="{{rootURL}}assets/start-discourse.js"></script>
<script defer src="{{rootURL}}assets/start-discourse.js" data-embroider-ignore></script>
<bootstrap-content key="body-footer"></bootstrap-content>
{{content-for "body-footer"}}

View File

@ -41,14 +41,16 @@
}
</style>
<script src="{{rootURL}}assets/test-i18n.js"></script>
<script src="{{rootURL}}assets/test-site-settings.js"></script>
<script src="{{rootURL}}assets/test-i18n.js" data-embroider-ignore></script>
<script src="{{rootURL}}assets/test-site-settings.js" data-embroider-ignore></script>
</head>
<body>
{{content-for "body"}} {{content-for "test-body"}}
<script src="/testem.js" integrity="" data-embroider-ignore></script>
<discourse-chunked-script entrypoint="vendor">
<script src="{{rootURL}}assets/vendor.js"></script>
</discourse-chunked-script>
<discourse-chunked-script entrypoint="test-support">
<script src="{{rootURL}}assets/test-support.js"></script>
@ -69,8 +71,8 @@
{{content-for "test-plugin-css"}}
{{content-for "test-plugin-js"}}
{{content-for "test-plugin-tests-js"}}
<script defer src="{{rootURL}}assets/scripts/discourse-test-trigger-ember-cli-boot.js"></script>
<script defer src="{{rootURL}}assets/scripts/discourse-boot.js"></script>
<script defer src="{{rootURL}}assets/scripts/discourse-test-trigger-ember-cli-boot.js" data-embroider-ignore></script>
<script defer src="{{rootURL}}assets/scripts/discourse-boot.js" data-embroider-ignore></script>
{{content-for "body-footer"}} {{content-for "test-body-footer"}}
</template>
@ -78,7 +80,7 @@
</discourse-dynamic-test-js>
<!-- This script takes the <template>, filters plugin assets as required, then appends to discourse-dynamic-test-js -->
<script src="{{rootURL}}assets/scripts/discourse-test-load-dynamic-js.js"></script>
<script src="{{rootURL}}assets/scripts/discourse-test-load-dynamic-js.js" data-embroider-ignore></script>
</body>
</html>