I got an error when I try to run webpack and awesome-typescript-loader, to package a typescript serverless function, with a dependency package named 'imagemin-jpegtran'.
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
WARNING in ./node_modules/bin-wrapper/index.js 5:34-41
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/jpegtran-bin/lib/index.js
@ ./node_modules/jpegtran-bin/index.js
@ ./node_modules/imagemin-jpegtran/index.js
@ ./src/index.ts
Hi,
I got an error when I try to run webpack and awesome-typescript-loader, to package a typescript serverless function, with a dependency package named
'imagemin-jpegtran'
.Edit : this error occurs because of bin-wrapper module which is using
require('import-lazy')(require);
https://github.com/kevva/bin-wrapper/blob/master/index.js#L5I hope somebody will be able to help me because I've tried so many different ways but always unsuccessfull...
Thank you
package.json
webpack.config.js
tsconfig.json
src/index.ts
Stacktrace