Coder Social home page Coder Social logo

Unexpected token `const` about auto-minify HOT 4 CLOSED

nizarmah avatar nizarmah commented on September 28, 2024 2
Unexpected token `const`

from auto-minify.

Comments (4)

nizarmah avatar nizarmah commented on September 28, 2024 1

Hello ( :
So, yeah I believe the problem is because of uglifyjs, since I am using it to minify the file.

UglifyJS does not support es6. const is an es6 declaration, so it throws an error.
ChrisR on StackOverflow

No worries though, I'll find a different package to use instead of uglifyjs. If you have any recommendations for annpm package that minifies JS files, please let me know.

You can solve the issue temporarily using var instead of const. But I promise you won't need to, I'll fix the issue today ( :

Edit:

I will be using babel-minify instead.

from auto-minify.

nizarmah avatar nizarmah commented on September 28, 2024 1

Released v1.6 with ES6+ Support on the Marketplace ( :
Just update the version you are currently using, and kindly let me know if you run into any new issues or if you have any recommendations!

Thanks a lot for all the contributions you have been doing. ❤️

from auto-minify.

C0pyR1ght avatar C0pyR1ght commented on September 28, 2024 1

great, thanks for your quick fix

from auto-minify.

nizarmah avatar nizarmah commented on September 28, 2024

I also tested it in Auto-Minify-Test/issues#5

Here's a screenshot of the commits ( :
image

Kindly let me know if there is anything else you'd want me to fix or add :D

By the way, I have been thinking of making it possible for users to pass their own "options" to the babel-minify and the clean-css commands being run. Let me know if that is something you are interested in so I work on adding it. If it isn't, so I don't waste time on it and work on something else.

from auto-minify.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.