base64-raw-loader

Webpack loader that imports the raw text content of a file as a base-64 string.

Usage no npm install needed!

<script type="module">
  import base64RawLoader from 'https://cdn.skypack.dev/base64-raw-loader';
</script>

README

base64-raw-loader

Webpack loader that imports the raw text content of a file as a base-64 encoded string.

https://www.npmjs.com/package/base64-raw-loader

Simple inline usage:


import templateContent from 'base64-raw-loader!./template.html';

// export it as a simple string
export { templateContent }

// or use it in code
console.log('encoded:', templateContent);
console.log('decoded:', atob(templateContent));