github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/jest-css-modules-transform-config.js (about)

     1  const path = require('path');
     2  
     3  module.exports = {
     4    sassConfig: {
     5      // So that we can import scss files using ~mymodule
     6      // https://github.com/Connormiha/jest-css-modules-transform/issues/32#issuecomment-787437223
     7      importer: [
     8        (url, prev) => {
     9          if (!url.startsWith('~')) return null;
    10  
    11          return {
    12            file: path.join(__dirname, `node_modules/${url.slice(1)}`),
    13          };
    14        },
    15      ],
    16    },
    17  };