diff --git a/utils/webpack.js b/utils/webpack.js index 5ddfa1d..01e060c 100644 --- a/utils/webpack.js +++ b/utils/webpack.js @@ -1,4 +1,6 @@ -function createConfig({entry, filename, outputPath, libraryName, externals}) { +const webpack = require('webpack'); + +function createConfig({ entry, filename, outputPath, libraryName, externals }) { const common = { mode: 'production', devtool: 'source-map', @@ -12,6 +14,16 @@ function createConfig({entry, filename, outputPath, libraryName, externals}) { }, ], }, + plugins: [ + // Workaround for Buffer is undefined: + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + }), + // Workaround for process is undefined: + new webpack.ProvidePlugin({ + process: 'process/browser', + }), + ], resolve: { extensions: ['.tsx', '.ts', '.js'], fallback: {