I am importing fluent-ffmpeg
with: import ffmpeg from 'fluent-ffmpeg'
in one file.
After running webpack, I receive this error:
Uncaught Exception: ReferenceError: fluent is not defined
I looked inside the transpiled file and I found fluent-ffmpeg
included like so:
function(e,t){e.exports=fluent-ffmpeg}
After changing the line to read: function(e,t){e.exports=require("fluent-ffmpeg")}
the programs work.
Is there a way to configure webpack to correctly require fluent-ffmpeg
when transpiling?
Edit: I am using this electron react webpack boilerplate to build a desktop application - https://github.com/chentsulin/electron-react-boilerplate
Update: I've created a repo to show the bug - https://github.com/the4dpatrick/congenial-barnacle. The difference between electron-react-boilerplate and this repo can be seen in a single commit
To see bug:
npm i
- packaging the electron app (
npm run package
) - opening the app which is under the release dir.
- Alert opens with error