1.0.1 • Published 1 year ago
virtual-resource-loader v1.0.1
virtual-resource-loader
virtual-resource-loader
allows you to create new modules inside a webpack compilation, without a file existing on disk. This is achieved in combination with webpack's matchResource feature.
Usage
// example-loader.js
export default exampleLoader() {
const virtualModuleSourceCode = '...';
const base64Source = Buffer.from(JSON.stringify(virtualModuleSourceCode), 'utf-8').toString(
'base64',
);
const request = `./my-virtual-file!=!virtual-resource-loader?source=${base64Source}!${loader.resourcePath}`;
return `
import ${request};
`;
}
1.0.1
1 year ago
0.0.0-tags-support-20231724743
1 year ago
0.0.0-tags-support-2023185232
1 year ago
0.0.0-package-files-20231142931
1 year ago
0.0.0-tags-support-2023174816
1 year ago
1.0.0
3 years ago