material-components-web: Unexpected token: name (MDCRipple) from UglifyJS

I am using Laravel Mix to compile my assets. Laravel Mix has a script to compile minified assets.

npm run production

This, in turn, invokes UglifyJS to minify assets. During this step it throws an error.

Unexpected token: name (MDCRipple) [./~/@material/ripple/index.js:25,0]

I am using material-components-web version 0.8.0.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@amrittb Your problem is you aren’t running js files through the babel-loader. There is no rule set for js files. Once you run the JS files through babel things compile properly.

I suspect what is going on for you @lpirola is around the same lines. You need to make sure the material component JS files get ran through babel. This means allowing node_module stuff to be compiled through babel.

I have created a Demo Repository. Here - Test Repository