mirror of
https://github.com/pezkuwichain/pezkuwi-extension.git
synced 2026-07-19 18:45:49 +00:00
5d54192e6d
- Update all copyright headers from 2025 to 2026 - Fix @polkadot references to @pezkuwi in config files - Fix eslint.config.js import path Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
29 lines
708 B
JavaScript
29 lines
708 B
JavaScript
// Copyright 2019-2026 @pezkuwi/extension-mocks authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import path from 'node:path';
|
|
import process from 'node:process';
|
|
import { pathToFileURL } from 'node:url';
|
|
|
|
/**
|
|
* Adjusts the resolver to point to empty files for .svg
|
|
*
|
|
* @param {*} specifier
|
|
* @param {*} context
|
|
* @param {*} nextResolve
|
|
* @returns {*}
|
|
*/
|
|
export function resolve (specifier, context, nextResolve) {
|
|
if (/\.(png|svg)$/.test(specifier)) {
|
|
return {
|
|
format: 'module',
|
|
shortCircuit: true,
|
|
url: pathToFileURL(
|
|
path.join(process.cwd(), 'packages/extension-mocks/src/empty.js')
|
|
).href
|
|
};
|
|
}
|
|
|
|
return nextResolve(specifier, context);
|
|
}
|