interpolate.js 433 B

123456789101112131415
  1. const { interpolateName } = require('loader-utils');
  2. /**
  3. * @param {string} pattern
  4. * @param {Object} options
  5. * @param {string} options.resourcePath
  6. * @param {string} [options.context]
  7. * @param {string} [options.content]
  8. */
  9. function interpolate(pattern, options) {
  10. const { resourcePath, context, content } = options;
  11. return interpolateName({ resourcePath }, pattern, { context, content });
  12. }
  13. module.exports = interpolate;