Production:build fails but reference line gets cleaned out

Hi Roots community,

I’ve got a build coming through clean but on build:production it errors at like so:

    webpack --progress -p --config resources/assets/build/webpack.config.js
    clean-webpack-plugin: /beta/site/web/app/themes/drishti/dist has been removed.
                                                                                      
ERROR in scripts/main_5f91dd25.js from UglifyJs
Unexpected token: operator (>) [scripts/main_5f91dd25.js:717,20]

My grievance :slight_smile: is that webpack clears out the dist folder after failing which means i can’t track down the offending line in the source files. Anyone able to help guide me to be able to debug this?

PS: build:production bombs only when i keep the exclude on npm module folders. If i comment that exclude in the JS rule out, it completes successfully. Surely that’s not a best practice right?

After countless hours i tracked down the issue.
I’m on Bootstrap 4 beta which requires popper js for it’s dropdowns.
popper.js was breaking my production builds through buble.

Fixed this by modifying the import to not go through buble:
import 'buble!popper.js/dist/popper.js';

1 Like

You might be missing this: https://github.com/roots/sage/pull/1946/files

2 Likes

Thanks Ben. Worked a charm!

Is there a Gulp/Bower equivalent of this for a Sage 8.* setup? Would be hugely appreciated!