soapbox/jest/assetTransformer.cjs

13 wiersze
362 B
JavaScript
Czysty Zwykły widok Historia

const path = require('path');
// Custom Jest asset transformer
// https://jestjs.io/docs/code-transformation#writing-custom-transformers
// Tries to do basically what Webpack does
module.exports = {
process(src, filename, config, options) {
2022-07-05 16:30:08 +00:00
return {
code: `module.exports = "https://soapbox.test/assets/${path.basename(filename)}";`,
};
},
};