diff --git a/patches/tr46.js b/patches/tr46.js new file mode 100644 index 0000000..f3efff4 --- /dev/null +++ b/patches/tr46.js @@ -0,0 +1,2 @@ +function toASCII(d) { return d; } +module.exports = { toASCII }; diff --git a/webpack.config.js b/webpack.config.js index 4b6ab34..f343944 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -195,7 +195,11 @@ function getExtensionConfig(target, mode, env) { ], }, resolve: { - alias: { '@env': path.resolve(__dirname, 'src', 'env', target === 'webworker' ? 'browser' : target) }, + alias: { + '@env': path.resolve(__dirname, 'src', 'env', target === 'webworker' ? 'browser' : target), + // This dependency is very large, and isn't needed for our use-case + tr46: path.resolve(__dirname, 'patches', 'tr46.js'), + }, fallback: target === 'webworker' ? { path: require.resolve('path-browserify') } : undefined, mainFields: target === 'webworker' ? ['browser', 'module', 'main'] : ['module', 'main'], extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],