UNPKG

404 BJavaScriptView Raw
1'use strict'
2
3const loaderUtils = require('loader-utils')
4
5module.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
16module.exports.raw = true