// Copyright 2019-2026 @polkadot/extension authors & contributors // SPDX-License-Identifier: Apache-2.0 // Bundles the tier-2 harness. Separate from the extension's own webpack config: // this is a page served to a browser alongside the extension, not part of it. const path = require('node:path'); module.exports = { entry: path.join(__dirname, 'src/harness.js'), experiments: { topLevelAwait: true }, mode: 'development', output: { filename: 'harness.js', path: path.join(__dirname, 'build') }, resolve: { alias: { // The workspace package resolves to its source directory, whose `main` // points at build output that only exists after `yarn build`. Point at it // directly so the harness builds from a plain checkout. '@polkadot/extension-dapp$': path.join(__dirname, '../../packages/extension-dapp/build/bundle.js') }, extensionAlias: { '.js': ['.js', '.ts'] }, // @quantus/codec inlines its WASM as base64 and never fetches it, but the // generated glue still mentions the file — see strip-wasm-fetch-init.mjs in // quantus/wasm. Nothing here should try to resolve it. fallback: { crypto: false } }, target: 'web' };