jkarsrud / ember-cli-defeatureify

Ember-CLI addon to defeatureify your apps
MIT License
18 stars 6 forks source link

"Unexpected reserved word" error when building #1

Closed jkarsrud closed 9 years ago

jkarsrud commented 9 years ago

As of now, Esprima doesn't support ES6 good enough to work directly on the app tree. This makes ember build fail with an "Unexpected reserved word"-error, and thus doesn't really defeature your code.

Related issues:

rwjblue commented 9 years ago

defeatureify must be run after the ES6 transpilation step

jkarsrud commented 9 years ago

@rwjblue Thanks! Is there anyway to access the transpiled modules from an addon?

jkarsrud commented 9 years ago

So, using the postprocessTree hook with the 'all'-tree from an addon will make it work, but it takes around 10 seconds in the app I've tested it in. Will look more into how we do it more like emberjs-build, where the list of features are seeded into the page for development builds, and only defeatureify on production builds.

jkarsrud commented 9 years ago

Running this on a production build of an Ember-CLI app seems to make defeatureify freak out — probably because the source has already been minified. This results in a Cannot read property 'length' of undefined error from defeatureify — not esprima this time.

rwjblue commented 9 years ago

Should be fixable now https://github.com/ember-cli/ember-cli/pull/3117.

rwjblue commented 9 years ago

I believe this can be closed.