1 |
|
2 |
|
3 | const loaderUtils = require('loader-utils')
|
4 |
|
5 | module.exports = function (content) {
|
6 | if (this.cacheable) { this.cacheable() }
|
7 |
|
8 | const toArrayBufferPath =
|
9 | loaderUtils.stringifyRequest(this, require.resolve('./to-array-buffer.js'))
|
10 |
|
11 | const base64Data = content.toString('base64')
|
12 |
|
13 | return `module.exports = require(${toArrayBufferPath})("${base64Data}")`;
|
14 | }
|
15 |
|
16 | module.exports.raw = true
|