Merge pull request #20286 from storybookjs/norbert/rebust-manager-entry-loading

Fix: ensure manager entries load even if preceding ones failed
This commit is contained in:
Norbert de Langen 2022-12-15 16:57:06 +01:00 committed by GitHub
commit a18a8f60db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -77,6 +77,14 @@ export const getConfig: ManagerBuilder['getConfig'] = async (options) => {
globalExternals(definitions),
pnpPlugin(),
],
banner: {
js: 'try{',
},
footer: {
js: '}catch(e){ console.log("ONE OF YOUR MANAGER-ENTRIES FAILED: " + import.meta.url) }',
},
define: {
'process.env.NODE_ENV': "'production'",
'process.env': '{}',

View File

@ -8,7 +8,6 @@
<link rel="icon" type="image/svg+xml" href="./favicon.svg">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="./sb-preview/runtime.mjs" rel="preload" as="script">
<% if (typeof head !== 'undefined') { %> <%- head %> <% } %>
@ -39,8 +38,10 @@
import './sb-manager/runtime.mjs';
<% files.js.forEach(file => { %>
import './<%= file %>';
import '<%= file %>';
<% }); %>
</script>
<link href="./sb-preview/runtime.mjs" rel="preload" as="script">
</body>
</html>