Add Object.assign polyfill support (#210)
* Add Object.assign polyfill support * Remove redundant polyfill check * Use ES6 in compatibility.js
This commit is contained in:
parent
e570c961e8
commit
5207629e87
|
@ -15,11 +15,13 @@
|
|||
"frontend_html": "script/vulcanize.js",
|
||||
"frontend_prod": "npm run js_prod && npm run frontend_html",
|
||||
"frontend_demo": "npm run js_demo && npm run frontend_html",
|
||||
"ru_all": "npm run ru_core && npm run ru_demo",
|
||||
"ru_all": "npm run ru_core && npm run ru_compatibility && npm run ru_demo",
|
||||
"ru_core": "rollup --config rollup/core.js",
|
||||
"ru_compatibility": "rollup --config rollup/compatibility.js",
|
||||
"ru_demo": "rollup --config rollup/demo.js",
|
||||
"watch_ru_all": "npm run watch_ru_core && npm run watch_ru_demo",
|
||||
"watch_ru_all": "(npm run watch_ru_core & npm run watch_ru_compatibility & npm run watch_ru_demo) && wait",
|
||||
"watch_ru_core": "rollup --config rollup/core.js --watch --sourcemap inline",
|
||||
"watch_ru_compatibility": "rollup --config rollup/compatibility.js --watch --sourcemap inline",
|
||||
"watch_ru_demo": "rollup --config rollup/demo.js --watch --sourcemap inline",
|
||||
"lint_js": "eslint src panels --ext html",
|
||||
"lint_html": "ls -1 src/home-assistant.html panels/**/ha-panel-*.html | xargs polymer lint --input",
|
||||
|
@ -32,6 +34,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"bower": "^1.8.0",
|
||||
"es6-object-assign": "^1.0.3",
|
||||
"eslint": "^3.14.0",
|
||||
"eslint-config-airbnb-base": "^11.0.1",
|
||||
"eslint-plugin-html": "^1.7.0",
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
import config from './base-config';
|
||||
|
||||
export default Object.assign({}, config, {
|
||||
entry: 'src/compatibility.js',
|
||||
targets: [
|
||||
{ dest: 'build/compatibility.js', format: 'iife' },
|
||||
],
|
||||
});
|
|
@ -21,13 +21,18 @@ var rootDir = '..';
|
|||
var panelDir = rootDir + '/panels';
|
||||
|
||||
var dynamicUrlToDependencies = {
|
||||
'/': [rootDir + '/frontend.html', rootDir + '/core.js'],
|
||||
'/': [
|
||||
rootDir + '/frontend.html',
|
||||
rootDir + '/core.js',
|
||||
rootDir + '/compatibility.js',
|
||||
],
|
||||
};
|
||||
|
||||
var staticFingerprinted = [
|
||||
'frontend.html',
|
||||
'mdi.html',
|
||||
'core.js',
|
||||
'compatibility.js',
|
||||
];
|
||||
|
||||
// These panels will always be registered inside HA and thus can
|
||||
|
|
|
@ -6,3 +6,7 @@ var optimizeJs = require('optimize-js');
|
|||
var core = fs.readFileSync('build/core.js', 'utf-8');
|
||||
core = optimizeJs(core);
|
||||
fs.writeFileSync('build/core.js', core);
|
||||
|
||||
var compatibility = fs.readFileSync('build/compatibility.js', 'utf-8');
|
||||
compatibility = optimizeJs(compatibility);
|
||||
fs.writeFileSync('build/compatibility.js', compatibility);
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
import objAssign from 'es6-object-assign';
|
||||
objAssign.polyfill();
|
|
@ -1762,6 +1762,10 @@ es6-map@^0.1.3:
|
|||
es6-symbol "~3.1.0"
|
||||
event-emitter "~0.3.4"
|
||||
|
||||
es6-object-assign@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.0.3.tgz#40a192e0fda5ee44ee8cf6f5b5d9b47cd0f69b14"
|
||||
|
||||
es6-promise@^2.1.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-2.3.0.tgz#96edb9f2fdb01995822b263dd8aadab6748181bc"
|
||||
|
|
Loading…
Reference in New Issue