
Loading…
ES6: vulcanize + babel produces errors b/c of strict mode issue(s) #2363
Owner
ebidel
commented
Owner
addyosmani
commented
Fixed as of a75133d?
This was referenced
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Atm, building an element in ES6 classes requires a transpiler like babel to work x-browser. That workflow looks something like this:
The full command is below. BabelJS adds
"use strict";to the top of the transpiled output:Unfortunately, this means JS errors, as parts of core 'use strict' and other parts do not.
Fix
Easiest fix is to get ride of this global, make it
window.Polymer = {.... I've confirmed changing this one line in the transpiled output works!vulcanize polymer.html --inline-script | crisper -h polymer.v.html -j polymer.v.b.js; babel --compact false polymer.v.b.js -o polymer.v.b.js