Fix custom panel include (#1539)

This commit is contained in:
Paulus Schoutsen 2018-08-04 15:15:44 +02:00 committed by GitHub
parent 50f417a7e2
commit a9f29a3151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,7 @@
} }
</style> </style>
<script> <script>
window.customPanelJS = '<%= customPanelJS %>';
window.noAuth = '{{ no_auth }}'; window.noAuth = '{{ no_auth }}';
window.useOAuth = '{{ use_oauth }}' window.useOAuth = '{{ use_oauth }}'
window.Polymer = { window.Polymer = {

View File

@ -95,7 +95,7 @@ It will have access to all data in Home Assistant.
`; `;
const iframeDoc = this.querySelector('iframe').contentWindow.document; const iframeDoc = this.querySelector('iframe').contentWindow.document;
iframeDoc.open(); iframeDoc.open();
iframeDoc.write(`<script src='${__PUBLIC_PATH__}custom-panel.js'></script>`); iframeDoc.write(`<script src='${window.customPanelJS}'></script>`);
iframeDoc.close(); iframeDoc.close();
} }

View File

@ -190,6 +190,7 @@ function createConfig(isProdBuild, latestBuild) {
compatibility: assets.chunks.compatibility.entry, compatibility: assets.chunks.compatibility.entry,
appjs: assets.chunks.app.entry, appjs: assets.chunks.app.entry,
corejs: assets.chunks.core.entry, corejs: assets.chunks.core.entry,
customPanelJS: assets.chunks['custom-panel'].entry,
}), }),
filename: `index.html`, filename: `index.html`,
}), }),