Files
webstudio/packages/jest-config/file-transform.js
T
Mateusz Burzyński 2c39885160 Add a file transform to jest to handle assets (#392)
closes #387

Note that the issue mentions adding an asset import to a story in
`react-sdk`. Right now you also get type errors there on those. In the
designer app you don't get those because types for assets are declared
within the `@remix-run/dev` typedefs that you reference:

https://github.com/webstudio-is/webstudio-designer/blob/a9c2b0e6b9a82ea7f1ff626c47519b8404a67b04/apps/designer/remix.env.d.ts#L1

This is a separate problem though and should be handled separately.
2022-11-07 19:28:47 +01:00

9 lines
216 B
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
module.exports = {
process(src, filename) {
return `module.exports = ${JSON.stringify(path.basename(filename))};`;
},
};