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

"Unable to compress and minify" when deploying ES6 syntax js thru steam #172

Closed
dahogenelst opened this issue Feb 1, 2020 · 1 comment
Closed

Comments

@dahogenelst
Copy link
Contributor

I saw this warning being thrown by Wagon.

  persisting javascripts/bundle.jsWarning: Unable to compress and minify it, error: Unexpected token: name (continues). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).
 [done]

Possibly having to do something with this issue. If I follow their suggestion, my ES6 JS is properly compressed and minified again.

I've replaced

self.js_compressor = :uglify
with self.js_compressor = Uglifier.new(harmony: true)

I don't really know for certain if I am properly using ES6, mixing it up with old school JS or doing something else wrong, but this helped solve my issue!

If you want a PR for this, I can make one.

@did
Copy link
Member

did commented Oct 15, 2020

hey @dahogenelst! In my recent LocomotiveCMS websites, I don't use Sprockets anymore to manage my JS/CSS but rather Webpack. More information about it here: https://doc.locomotivecms.com/docs/manage-js-and-css-with-webpack.

@did did closed this as completed Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants