Archived
1
0

Use inline file-loader for require.toUrl

Instead of trying to match on the string, because that string could be
anything or change in future versions.
This commit is contained in:
Asher
2019-02-04 14:03:59 -06:00
committed by Kyle Carberry
parent 55f9c81516
commit c80b2fabc3
3 changed files with 28 additions and 49 deletions

View File

@ -27,23 +27,6 @@ module.exports = (env) => {
},
module: {
rules: [{
loader: "string-replace-loader",
test: /\.(js|ts)$/,
options: {
multiple: [
{
search: "require\\.toUrl\\(",
replace: "requireToUrl(",
flags: "g",
},
{
search: "require\\.__\\$__nodeRequire",
replace: "require",
flags: "g",
},
],
},
}, {
// Ignore a bunch of file types we don't have loaders for. Also ignore
// test directories, some files with invalid JSON, and files we don't
// actually require but throw warnings or errors. This all seems to be a