mirror of
https://github.com/elyby/emails-renderer.git
synced 2024-12-22 13:19:45 +05:30
17 lines
368 B
JavaScript
17 lines
368 B
JavaScript
/* eslint-env node */
|
|
|
|
const { getOptions } = require('loader-utils');
|
|
const text2png = require('text2png');
|
|
|
|
module.exports = function() {
|
|
this.cacheable && this.cacheable();
|
|
|
|
const { text, ...options } = getOptions(this);
|
|
if (!text) {
|
|
this.emitError('The text param is required');
|
|
return '';
|
|
}
|
|
|
|
return text2png(text, options);
|
|
};
|