glimmerjs / glimmer-web-component

Library to boot up your Glimmer components as Web Components
https://glimmerjs.com/guides/using-glimmer-as-web-components
MIT License
30 stars 11 forks source link

Prod builds fail when glimmer-web-component included #7

Closed boztek closed 7 years ago

boztek commented 7 years ago

Same behaviour either adding glimmer-web-component to a glimmer-blueprint project or using the --web-component option:

$ ember build -prod
cleaning up...
Built project successfully. Stored in "dist/".
File sizes:
 - dist/app-1a294d2bf122a6c7c5987eb976e42e67.css: 22 B (42 B gzipped)
 - dist/app-f9d54e235f22598246a38ee880f3a64a.js: 153.39 KB (33.52 KB gzipped)

$ yarn add --dev @glimmer/web-component
...

$ ember build -prod
cleaning up...
Build failed.
File: app.js (7:6)
The Broccoli Plugin: [UglifyWriter] failed with:
SyntaxError: The Broccoli Plugin: [UglifyWriter] failed with:
    at JS_Parse_Error.get (eval at <anonymous> (/private/tmp/demo-glimmer-app/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:86:23)
    at writeError (/private/tmp/demo-glimmer-app/node_modules/console-ui/lib/write-error.js:23:23)
    at UI.writeError (/private/tmp/demo-glimmer-app/node_modules/console-ui/lib/index.js:159:3)
    at CLI.logError (/private/tmp/demo-glimmer-app/node_modules/ember-cli/lib/cli/cli.js:275:13)
    at tryCatch (/private/tmp/demo-glimmer-app/node_modules/rsvp/dist/rsvp.js:539:12)
    at invokeCallback (/private/tmp/demo-glimmer-app/node_modules/rsvp/dist/rsvp.js:554:13)
    at publish (/private/tmp/demo-glimmer-app/node_modules/rsvp/dist/rsvp.js:522:7)
    at publishRejection (/private/tmp/demo-glimmer-app/node_modules/rsvp/dist/rsvp.js:457:3)
    at flush (/private/tmp/demo-glimmer-app/node_modules/rsvp/dist/rsvp.js:2414:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)

My versions:

 $  ember version
ember-cli: 2.12.1
node: 6.10.0
os: darwin x64

and @glimmer/web-component 0.1.0

pittst3r commented 7 years ago

@boztek Thanks, I was able to reproduce. Investigating.

pittst3r commented 7 years ago

Okay, so the release version of Uglify 2 only supports es5: https://github.com/mishoo/UglifyJS2#note

Working on the solution to this. We'll either end up using the harmony branch of uglify in broccoli-uglify-sourcemap or transpile to es5 and use webcomponents/native-shim.

pittst3r commented 7 years ago

Solved with #13 😎