Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
// eslint-disable-next-line no-console
console.log('Using a memfs filesystem...');
const memfs = require('memfs');
const vol = new memfs.Volume();
const fs = memfs.createFsFromVolume(vol);
module.exports = fs;
module.exports.volume = vol;
import * as fs from 'fs';
import {Volume} from 'memfs';
import {dirname, join} from 'path';
import {Union} from 'unionfs';
import {promisify} from 'util';
import {compilation, Compiler} from 'webpack';
import {htmlModuleToJsModuleMap} from '../html-module-transform.js';
const readFile = promisify(fs.readFile);
const realpath = promisify(fs.realpath);
const ufs = new Union();
const vfs = new Volume();
ufs.use(fs).use(vfs);
const pluginName = 'HTML Modules Transform';
export interface HtmlModulesPluginOptions {
htmlModuleTest?: (options: WebpackModuleFactoryOptions) => boolean;
}
export interface WebpackModuleFactoryOptions {
contextInfo: {
// The absolute path to the source file of the importing module:
issuer: string
};
// The root directory of the compilation (I think.....)
context: string;
private init() {
this.volume = new Volume()
this.fs = createFsFromVolume(this.volume)
this.reset()
}
}