GithubHelp home page GithubHelp logo

Comments (8)

NordlingDev avatar NordlingDev commented on June 12, 2024 1

I've tried the builtin UglifyJS in the latest Webpack. I also tried the beta version of latest UglifyJS 3 (which uses Harmony). It got past the error, but instead I have mangling issues which probably relates to how Uglify handles mangling of node_modules folder (mangle: false seems to ignore node_modules folder).

from dropkick.

mladimatija avatar mladimatija commented on June 12, 2024 1

I am getting this error as well, using DropKick in congregation with roots' Sage 9 beta 4.

ERROR Failed to compile with 1 errors scripts/main_678f8f2f.js from UglifyJs Unexpected token: name (_docListener) [scripts/main_678f8f2f.js:3142,4]

from dropkick.

Robdel12 avatar Robdel12 commented on June 12, 2024 1

Ah crap. It's because uglify 2.x and below can't handle ES6 classes. So there are two options here:

  • Upgrade to uglify 3
  • Transpile the DK class before going through uglify (exclude: /node_modules\/(?!(dropkickjs)\/).*/)

Honestly neither of those are awesome and I didn't know consuming projects would have to explicitly include this module in their transpilation... Changes will have to be made.

from dropkick.

Robdel12 avatar Robdel12 commented on June 12, 2024

Interesting. Are you using the already minified version in your project or importing the module?

from dropkick.

NordlingDev avatar NordlingDev commented on June 12, 2024

@Robdel12 - I'm importing from NPM. Every other node modules can be bundled together with UglifyJS, just not DropKick.

from dropkick.

Robdel12 avatar Robdel12 commented on June 12, 2024

What version of webpack and uglify? I use uglify to compile the built version

from dropkick.

NordlingDev avatar NordlingDev commented on June 12, 2024

@Robdel12 - I'll stay with a min.js file in the meanwhile. Just to keep things simple. Thank you for getting into it!

from dropkick.

mladimatija avatar mladimatija commented on June 12, 2024

@Robdel12 I ended up excluding the dropkick class, should be good as a temp fix. Thanks for the solution!

from dropkick.

Related Issues (20)

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.