Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eppo/js-client-sdk",
"version": "3.8.1",
"version": "3.8.2",
"description": "Eppo SDK for client-side JavaScript applications",
"main": "dist/index.js",
"files": [
Expand Down
15 changes: 15 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const path = require('path');

const TerserPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');

module.exports = {
entry: './src/index.ts',
Expand All @@ -19,6 +20,10 @@ module.exports = {
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
fallback: {
// resolve the Buffer polyfill
buffer: require.resolve('buffer'),
},
},
output: {
filename: 'eppo-sdk.js',
Expand All @@ -32,4 +37,14 @@ module.exports = {
minimize: true,
minimizer: [new TerserPlugin()],
},
plugins: [
// Replace process.env.LOG_LEVEL with null (`process` is not defined in the browser env)
new webpack.DefinePlugin({
'process.env.LOG_LEVEL': null,
}),
// Make sure any usages of Buffer use the polyfill in the browser
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in theory no longer necessary now that we replaced Buffer with js-base64 in the common sdk, but I think it's worth leaving it here to cover our basis in case something else slips in the future

],
};
Loading