Some of my code does not seem to go through Babel before arriving in Uglify

3

I am not able to generate the production build of my application with Laravel Mix. When trying to build the build, npm tells me that there was an error while trying to run UglifyJs:

  

/js/app.js from UglifyJs
  Unexpected token: operator (>) [./~/bootstrap/js/src/modal.js:11,0] [/ js / app.js: 34863,20]

I've been looking at the code and on line 11 of modal.js (from bootstrap 4 alpha, which I'm importing by component as needed) has an arrow function . It is she who is making the mistake. If I remove the import from modal.js, the build completes normally.

My diagnosis is that this file is not going through Babel before arriving in Uglify. This seems very strange, since the rest of my code seems to be going through Babel normally.

My webpack.mix.js is the default:

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css');

I do not have much experience with Laravel Mix, and I'm far from deciphering all the mysteries of the webpack ... Does anyone know why this is happening, and how to solve it?

    
asked by anonymous 13.05.2017 / 18:07

0 answers