Skip to content

Commit d380894

Browse files
committed
Switch from webpack to rspack
1 parent 6a468a0 commit d380894

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

rspack.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ module.exports = {
8585
}
8686
],
8787
plugins: [
88+
// Convert ESM import.meta.dirname/filename to CommonJS equivalents.
89+
// Required because @httptoolkit/browser-launcher is ESM and uses import.meta.dirname,
90+
// but we output CommonJS where import.meta isn't available.
91+
new rspack.DefinePlugin({
92+
'import.meta.dirname': '__dirname',
93+
'import.meta.filename': '__filename'
94+
}),
8895
// Optimistic require for 'iconv' in 'encoding', falls back to 'iconv-lite'
8996
new rspack.NormalModuleReplacementPlugin(/\/iconv-loader$/, 'node-noop'),
9097
// Optimistically required in (various) ws versions, with fallback

0 commit comments

Comments
 (0)