mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
Fix nanoid and uuid in extension
This commit is contained in:
parent
3da78ff885
commit
3faabd4765
|
@ -5,4 +5,5 @@ module.exports = {
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
},
|
},
|
||||||
|
resolver: '<rootDir>/jestResolver.js',
|
||||||
};
|
};
|
||||||
|
|
15
extension/jestResolver.js
Normal file
15
extension/jestResolver.js
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
module.exports = (path, options) => {
|
||||||
|
return options.defaultResolver(path, {
|
||||||
|
...options,
|
||||||
|
packageFilter: (pkg) => {
|
||||||
|
if (pkg.name === 'nanoid') {
|
||||||
|
pkg.exports['.'].browser = pkg.exports['.'].require;
|
||||||
|
}
|
||||||
|
if (pkg.name === 'uuid' && pkg.version.startsWith('8.')) {
|
||||||
|
delete pkg.exports;
|
||||||
|
delete pkg.module;
|
||||||
|
}
|
||||||
|
return pkg;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user