Skip to content

Commit

Permalink
Remove Node.js polyfills from simulator Webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Feb 23, 2024
1 parent 6b573ef commit 7b04230
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions packages/snaps-simulator/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
DllPlugin,
DllReferencePlugin,
EnvironmentPlugin,
NormalModuleReplacementPlugin,
} from 'webpack';
import type { Configuration as DevServerConfiguration } from 'webpack-dev-server';
import { merge } from 'webpack-merge';
Expand Down Expand Up @@ -59,27 +58,9 @@ const baseConfig: Configuration = {
baseUrl: __dirname,
}),
],
/* eslint-disable @typescript-eslint/naming-convention */
fallback: {
assert: false,
child_process: false,
constants: false,
crypto: false,
fs: false,
http: false,
https: false,
module: false,
stream: require.resolve('stream-browserify'),
_stream_transform: require.resolve(
'readable-stream/lib/_stream_transform.js',
),
os: false,
path: false,
util: false,
worker_threads: false,
zlib: false,
},
/* eslint-enable @typescript-eslint/naming-convention */
},
plugins: [
new ProvidePlugin({
Expand Down Expand Up @@ -152,17 +133,6 @@ const baseAppConfig = merge<Configuration & DevServerConfiguration>(
},
],
},
/* eslint-disable @typescript-eslint/naming-convention */
externals: {
'node:module': 'commonjs module',
},
resolve: {
fallback: {
assert: require.resolve('assert/'),
constants: require.resolve('constants-browserify'),
},
},
/* eslint-enable @typescript-eslint/naming-convention */
plugins: [
new DllReferencePlugin({
manifest: VENDOR_MANIFEST_PATH,
Expand All @@ -183,14 +153,6 @@ const baseAppConfig = merge<Configuration & DevServerConfiguration>(
},
],
}),

// Stop attempting to bundle the Node.js execution services. They are
// not used in the browser, and attempting to bundle them causes
// errors.
new NormalModuleReplacementPlugin(
/.*services\/node.*/u,
resolve(__dirname, 'src', 'stub.ts'),
),
],
cache: {
type: 'filesystem',
Expand Down

0 comments on commit 7b04230

Please sign in to comment.