Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES6: vulcanize + babel produces errors b/c of strict mode issue(s) #2363

Closed
ebidel opened this issue Aug 24, 2015 · 1 comment · Fixed by #2365
Closed

ES6: vulcanize + babel produces errors b/c of strict mode issue(s) #2363

ebidel opened this issue Aug 24, 2015 · 1 comment · Fixed by #2365
Assignees

Comments

@ebidel
Copy link
Contributor

ebidel commented Aug 24, 2015

Atm, building an element in ES6 classes requires a transpiler like babel to work x-browser. That workflow looks something like this:

  1. vulcanize | cripser (to get separate output.js file)
  2. babel output.js

The full command is below. BabelJS adds "use strict"; to the top of the transpiled output:

screen shot 2015-08-24 at 4 26 47 pm

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

@ebidel ebidel added the p1 label Aug 24, 2015
@ebidel ebidel changed the title ES6 classes: vulcanize + babel produces errors b/c of strict mode issue(s) ES6: vulcanize + babel produces errors b/c of strict mode issue(s) Aug 24, 2015
@sjmiles sjmiles self-assigned this Aug 25, 2015
@addyosmani
Copy link
Member

Fixed as of a75133d?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants