1.1.0 • Published 3 years ago
typescript-fs-read-loader v1.1.0
Webpack loader for inlining fs.readFileSync calls
This loader uses the Typescript compiler API to find fs.readFileSync calls and inlines the file's contents as strings in the built bundle. You must
use a filepath that is relative to the typescript file's __dirname
for the loader to work:
import { readFileSync } from "fs";
const file = readFileSync(__dirname + "/path/to/file.txt");