webpack-virtual-modules
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -94,2 +94,7 @@ "use strict"; | ||
} | ||
function getRealpathBackend(fileSystem) { | ||
if (fileSystem._realpathBackend) { | ||
return fileSystem._realpathBackend; | ||
} | ||
} | ||
class VirtualModulesPlugin { | ||
@@ -197,2 +202,3 @@ constructor(modules) { | ||
const readDirStorage = getReadDirBackend(finalInputFileSystem); | ||
const realPathStorage = getRealpathBackend(finalInputFileSystem); | ||
finalInputFileSystem._virtualFiles = finalInputFileSystem._virtualFiles || {}; | ||
@@ -229,2 +235,5 @@ finalInputFileSystem._virtualFiles[file] = { stats: stats, contents: contents }; | ||
setData(readDirStorage, dir, createWebpackData([])); | ||
if (realPathStorage) { | ||
setData(realPathStorage, dir, createWebpackData(dir)); | ||
} | ||
setData(statStorage, dir, createWebpackData(dirStats)); | ||
@@ -231,0 +240,0 @@ } |
{ | ||
"name": "webpack-virtual-modules", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Webpack Virtual Modules", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -104,2 +104,10 @@ import path from 'path'; | ||
function getRealpathBackend(fileSystem) { | ||
if (fileSystem._realpathBackend) { | ||
return fileSystem._realpathBackend; | ||
} | ||
// Nothing, because not all version of webpack support it | ||
} | ||
class VirtualModulesPlugin { | ||
@@ -244,2 +252,4 @@ private _staticModules: Record<string, string> | null; | ||
const readDirStorage = getReadDirBackend(finalInputFileSystem); | ||
const realPathStorage = getRealpathBackend(finalInputFileSystem); | ||
finalInputFileSystem._virtualFiles = finalInputFileSystem._virtualFiles || {}; | ||
@@ -276,2 +286,5 @@ finalInputFileSystem._virtualFiles[file] = { stats: stats, contents: contents }; | ||
setData(readDirStorage, dir, createWebpackData([])); | ||
if (realPathStorage) { | ||
setData(realPathStorage, dir, createWebpackData(dir)); | ||
} | ||
setData(statStorage, dir, createWebpackData(dirStats)); | ||
@@ -278,0 +291,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46451
722