Add es5 adapter to es5 panel

This commit is contained in:
Paulus Schoutsen 2018-06-08 14:11:34 -04:00
parent 10c997b7b2
commit f8c2e9d476
2 changed files with 8 additions and 2 deletions

View File

@ -25,6 +25,10 @@ function setProperties(properties) {
}
function initialize(panel, properties) {
const style = document.createElement('style');
style.innerHTML = 'body{margin:0}';
document.head.appendChild(style);
const config = panel.config._panel_custom;
let start = Promise.resolve();

View File

@ -37,7 +37,10 @@ function createConfig(isProdBuild, latestBuild) {
],
};
const copyPluginOpts = [];
const copyPluginOpts = [
// Leave here until Hass.io no longer references the ES5 build.
'node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js'
];
const plugins = [
new webpack.DefinePlugin({
@ -69,7 +72,6 @@ function createConfig(isProdBuild, latestBuild) {
copyPluginOpts.push('node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js.map')
copyPluginOpts.push({ from: 'node_modules/leaflet/dist/leaflet.css', to: `images/leaflet/` });
copyPluginOpts.push({ from: 'node_modules/leaflet/dist/images', to: `images/leaflet/` });
copyPluginOpts.push('node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js');
entry['hass-icons'] = './src/entrypoints/hass-icons.js';
entry['service-worker-hass'] = './src/entrypoints/service-worker-hass.js';
} else {