I'm importing Popper.js like this:
import Popper from 'popper.js';
window.Popper = Popper;
And it works perfectly, but in my Browser console I see the following error message:
https://example.com/js/popper.js.map: Failed to load resource: the server responded with a status of 404 (HTTP/2.0 404)
Is there any way to strip all source map references in JavaScript files?
I don't think it is Laravel mix fault.
Popper.js npm package comes with sourcemap files, (screenshot)

The umd/popper.js file has a link to these sourcemap files, see next source code
https://unpkg.com/[email protected]/dist/umd/popper.js
When you open up devtools, chrome tries to download these linked map files but could not, because these files are in node_modules (behind your public folder).
FYI: Chrome will not download source map file unless you open dev tools.
Popper.js provides the maps, so it's not its fault if they don't get served by Laravel
It's actually Safari that tries to download it, not Chrome.
Is there an easy way to strip comments containing sourceMappingURL with Mix?
The following code solved it for me:
import { Popper } from 'popper.js'
window.Popper = Popper
I have added
{}around Popper
Most helpful comment
It's actually Safari that tries to download it, not Chrome.
Is there an easy way to strip comments containing
sourceMappingURLwith Mix?