@tybys/native-require
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "@tybys/native-require", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Try to get native require function in any environment.", | ||
@@ -5,0 +5,0 @@ "module": "index.esm.js", |
@@ -5,3 +5,4 @@ exports.nativeRequireRollupPlugin = function () { | ||
renderChunk (code /*, chunk, options */) { | ||
return code.replace(/function\s+commonjsRequire\s+\(\)\s+\{\s*(\r?\n)*throw new Error\(['"]Dynamic requires are not currently supported by @rollup\/plugin-commonjs['"]\);\s*(\r?\n)*\s*}/g, '') | ||
return code.replace(/function\s+commonjsRequire\s+\(\)\s+\{\s*(\r?\n)*\s*throw new Error\(['"]Dynamic requires are not currently supported by @rollup\/plugin-commonjs['"]\);\s*(\r?\n)*\s*\}/g, '') | ||
.replace(/function\s+commonjsRequire\s+\((.+?)\)\s+\{\s*(\r?\n)*\s*throw new Error\(['"]Could not dynamically require ['"](.+?)\);\s*(\r?\n)*\s*\}/g, '') | ||
.replace(/commonjsRequire/g, 'require') | ||
@@ -8,0 +9,0 @@ } |
17051
299