diff --git a/.gitignore b/.gitignore index 878f41ba..769b6d58 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ dist/**/*.js !test/integration/*.json !test/integration/*.js !test/integration/*.ts +!test/integration/include/ +!test/integration/include/*.js !test/integration/node-path !test/integration/node-path/*.js !test/unit diff --git a/src/index.js b/src/index.js index aad53448..36306867 100644 --- a/src/index.js +++ b/src/index.js @@ -141,7 +141,8 @@ module.exports = ( path: "/", // Webpack only emits sourcemaps for files ending in .js filename: ext === '.cjs' ? filename + '.js' : filename, - libraryTarget: "commonjs2" + libraryTarget: "commonjs2", + strictModuleExceptionHandling: true }, resolve: { extensions: SUPPORTED_EXTENSIONS, diff --git a/test/integration/include/throwing.js b/test/integration/include/throwing.js new file mode 100644 index 00000000..391b308b --- /dev/null +++ b/test/integration/include/throwing.js @@ -0,0 +1 @@ +throw new Error('kaboom') diff --git a/test/integration/strict-module-exception-handling.js b/test/integration/strict-module-exception-handling.js new file mode 100644 index 00000000..fa75d56b --- /dev/null +++ b/test/integration/strict-module-exception-handling.js @@ -0,0 +1,14 @@ +try { + require('./include/throwing') +} catch (err) {} + +let threw = false +try { + require('./include/throwing') +} catch (err) { + threw = true +} + +if (!threw) { + process.exit(1) +} diff --git a/test/unit/externals/output-coverage.js b/test/unit/externals/output-coverage.js index 8e3e0163..84a328a7 100644 --- a/test/unit/externals/output-coverage.js +++ b/test/unit/externals/output-coverage.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/externals/output.js b/test/unit/externals/output.js index a31c3913..f0d77afe 100644 --- a/test/unit/externals/output.js +++ b/test/unit/externals/output.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/minify/output-coverage.js b/test/unit/minify/output-coverage.js index 0ee64ce2..88323f15 100644 --- a/test/unit/minify/output-coverage.js +++ b/test/unit/minify/output-coverage.js @@ -1,2 +1,2 @@ -module.exports=function(r,e){"use strict";var t={};function __webpack_require__(e){if(t[e]){return t[e].exports}var _=t[e]={i:e,l:false,exports:{}};r[e].call(_.exports,_,_.exports,__webpack_require__);_.l=true;return _.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(894)}return startup()}({894:function(r,e){const t="qux";e.foobar=t}}); -//# sourceMappingURL=index.js.map \ No newline at end of file +module.exports=function(r,e){"use strict";var t={};function __webpack_require__(e){if(t[e]){return t[e].exports}var _=t[e]={i:e,l:false,exports:{}};var u=true;try{r[e].call(_.exports,_,_.exports,__webpack_require__);u=false}finally{if(u)delete t[e]}_.l=true;return _.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(894)}return startup()}({894:function(r,e){const t="qux";e.foobar=t}}); +//# sourceMappingURL=index.js.map diff --git a/test/unit/minify/output-coverage.js.map b/test/unit/minify/output-coverage.js.map index 36d3f443..a998f033 100644 --- a/test/unit/minify/output-coverage.js.map +++ b/test/unit/minify/output-coverage.js.map @@ -1 +1 @@ -{"version":3,"sources":["/webpack/bootstrap","../test/unit/minify/input.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","ab","__dirname","startup","foobar"],"mappings":"0CACA,IAAAA,EAAA,GAGA,SAAAC,oBAAAC,GAGA,GAAAF,EAAAE,GAAA,CACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,EAAA,MACAH,QAAA,IAIAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,EAAAA,EAAAD,QAAAF,qBAGAG,EAAAE,EAAA,KAGA,OAAAF,EAAAD,QAIAF,oBAAAQ,GAAAC,UAAA,IAGA,SAAAC,UAEA,OAAAV,oBAAA,KAIA,OAAAU,8BCrCA,MAAAC,EAAA,MACAT,EAAOS,OAAAA","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t__webpack_require__.ab = __dirname + \"/\";\n\n \t// the startup function\n \tfunction startup() {\n \t\t// Load entry module and return exports\n \t\treturn __webpack_require__(894);\n \t};\n\n \t// run startup\n \treturn startup();\n","const foobar = 'qux'\nexports.foobar = foobar\n"]} \ No newline at end of file +{"version":3,"sources":["/webpack/bootstrap","../test/unit/minify/input.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","threw","modules","call","ab","__dirname","startup","foobar"],"mappings":"0CACA,IAAAA,EAAA,GAGA,SAAAC,oBAAAC,GAGA,GAAAF,EAAAE,GAAA,CACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,EAAA,MACAH,QAAA,IAIA,IAAAI,EAAA,KACA,IACAC,EAAAN,GAAAO,KAAAL,EAAAD,QAAAC,EAAAA,EAAAD,QAAAF,qBACAM,EAAA,MACI,QACJ,GAAAA,SAAAP,EAAAE,GAIAE,EAAAE,EAAA,KAGA,OAAAF,EAAAD,QAIAF,oBAAAS,GAAAC,UAAA,IAGA,SAAAC,UAEA,OAAAX,oBAAA,KAIA,OAAAW,8BC3CA,MAAAC,EAAA,MACAV,EAAOU,OAAAA","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tvar threw = true;\n \t\ttry {\n \t\t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n \t\t\tthrew = false;\n \t\t} finally {\n \t\t\tif(threw) delete installedModules[moduleId];\n \t\t}\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t__webpack_require__.ab = __dirname + \"/\";\n\n \t// the startup function\n \tfunction startup() {\n \t\t// Load entry module and return exports\n \t\treturn __webpack_require__(894);\n \t};\n\n \t// run startup\n \treturn startup();\n","const foobar = 'qux'\nexports.foobar = foobar\n"]} diff --git a/test/unit/minify/output.js b/test/unit/minify/output.js index 08b31d1e..fa1c08e3 100644 --- a/test/unit/minify/output.js +++ b/test/unit/minify/output.js @@ -1,2 +1,2 @@ -module.exports=function(r,e){"use strict";var t={};function __webpack_require__(e){if(t[e]){return t[e].exports}var _=t[e]={i:e,l:false,exports:{}};r[e].call(_.exports,_,_.exports,__webpack_require__);_.l=true;return _.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(657)}return startup()}({657:function(r,e){const t="qux";e.foobar=t}}); -//# sourceMappingURL=index.js.map \ No newline at end of file +module.exports=function(r,e){"use strict";var t={};function __webpack_require__(e){if(t[e]){return t[e].exports}var _=t[e]={i:e,l:false,exports:{}};var u=true;try{r[e].call(_.exports,_,_.exports,__webpack_require__);u=false}finally{if(u)delete t[e]}_.l=true;return _.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(657)}return startup()}({657:function(r,e){const t="qux";e.foobar=t}}); +//# sourceMappingURL=index.js.map diff --git a/test/unit/minify/output.js.map b/test/unit/minify/output.js.map index 96aeb2e4..1742e349 100644 --- a/test/unit/minify/output.js.map +++ b/test/unit/minify/output.js.map @@ -1 +1 @@ -{"version":3,"sources":["/webpack/bootstrap","../test/unit/minify/input.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","ab","__dirname","startup","foobar"],"mappings":"0CACA,IAAAA,EAAA,GAGA,SAAAC,oBAAAC,GAGA,GAAAF,EAAAE,GAAA,CACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,EAAA,MACAH,QAAA,IAIAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,EAAAA,EAAAD,QAAAF,qBAGAG,EAAAE,EAAA,KAGA,OAAAF,EAAAD,QAIAF,oBAAAQ,GAAAC,UAAA,IAGA,SAAAC,UAEA,OAAAV,oBAAA,KAIA,OAAAU,8BCrCA,MAAAC,EAAA,MACAT,EAAOS,OAAAA","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t__webpack_require__.ab = __dirname + \"/\";\n\n \t// the startup function\n \tfunction startup() {\n \t\t// Load entry module and return exports\n \t\treturn __webpack_require__(657);\n \t};\n\n \t// run startup\n \treturn startup();\n","const foobar = 'qux'\nexports.foobar = foobar\n"]} \ No newline at end of file +{"version":3,"sources":["/webpack/bootstrap","../test/unit/minify/input.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","threw","modules","call","ab","__dirname","startup","foobar"],"mappings":"0CACA,IAAAA,EAAA,GAGA,SAAAC,oBAAAC,GAGA,GAAAF,EAAAE,GAAA,CACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,EAAA,MACAH,QAAA,IAIA,IAAAI,EAAA,KACA,IACAC,EAAAN,GAAAO,KAAAL,EAAAD,QAAAC,EAAAA,EAAAD,QAAAF,qBACAM,EAAA,MACI,QACJ,GAAAA,SAAAP,EAAAE,GAIAE,EAAAE,EAAA,KAGA,OAAAF,EAAAD,QAIAF,oBAAAS,GAAAC,UAAA,IAGA,SAAAC,UAEA,OAAAX,oBAAA,KAIA,OAAAW,8BC3CA,MAAAC,EAAA,MACAV,EAAOU,OAAAA","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tvar threw = true;\n \t\ttry {\n \t\t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n \t\t\tthrew = false;\n \t\t} finally {\n \t\t\tif(threw) delete installedModules[moduleId];\n \t\t}\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t__webpack_require__.ab = __dirname + \"/\";\n\n \t// the startup function\n \tfunction startup() {\n \t\t// Load entry module and return exports\n \t\treturn __webpack_require__(657);\n \t};\n\n \t// run startup\n \treturn startup();\n","const foobar = 'qux'\nexports.foobar = foobar\n"]} diff --git a/test/unit/runtime-notfound/output-coverage.js b/test/unit/runtime-notfound/output-coverage.js index 76d54e6f..9872f369 100644 --- a/test/unit/runtime-notfound/output-coverage.js +++ b/test/unit/runtime-notfound/output-coverage.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/runtime-notfound/output.js b/test/unit/runtime-notfound/output.js index ce9b1fe6..1d053354 100644 --- a/test/unit/runtime-notfound/output.js +++ b/test/unit/runtime-notfound/output.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/shebang/output-coverage.js b/test/unit/shebang/output-coverage.js index 571ba32a..e1ff4ba0 100644 --- a/test/unit/shebang/output-coverage.js +++ b/test/unit/shebang/output-coverage.js @@ -20,7 +20,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/shebang/output.js b/test/unit/shebang/output.js index 7598b825..d93d7fd5 100644 --- a/test/unit/shebang/output.js +++ b/test/unit/shebang/output.js @@ -20,7 +20,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/ts-decl/output-coverage.js b/test/unit/ts-decl/output-coverage.js index 5a0a3d79..2603e52f 100644 --- a/test/unit/ts-decl/output-coverage.js +++ b/test/unit/ts-decl/output-coverage.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/ts-decl/output.js b/test/unit/ts-decl/output.js index 18739246..1582a54b 100644 --- a/test/unit/ts-decl/output.js +++ b/test/unit/ts-decl/output.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/ts-exts/output-coverage.js b/test/unit/ts-exts/output-coverage.js index a31220e5..e54b6306 100644 --- a/test/unit/ts-exts/output-coverage.js +++ b/test/unit/ts-exts/output-coverage.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/ts-exts/output.js b/test/unit/ts-exts/output.js index dc51ed6d..60aff731 100644 --- a/test/unit/ts-exts/output.js +++ b/test/unit/ts-exts/output.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/tsconfig-paths-allowjs/output-coverage.js b/test/unit/tsconfig-paths-allowjs/output-coverage.js index 431e4c2a..51d9d10a 100644 --- a/test/unit/tsconfig-paths-allowjs/output-coverage.js +++ b/test/unit/tsconfig-paths-allowjs/output-coverage.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/tsconfig-paths-allowjs/output.js b/test/unit/tsconfig-paths-allowjs/output.js index a3ca2ee6..df878df0 100644 --- a/test/unit/tsconfig-paths-allowjs/output.js +++ b/test/unit/tsconfig-paths-allowjs/output.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/tsconfig-paths-conflicting-external/output-coverage.js b/test/unit/tsconfig-paths-conflicting-external/output-coverage.js index 4680131f..698b2fb0 100644 --- a/test/unit/tsconfig-paths-conflicting-external/output-coverage.js +++ b/test/unit/tsconfig-paths-conflicting-external/output-coverage.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/tsconfig-paths-conflicting-external/output.js b/test/unit/tsconfig-paths-conflicting-external/output.js index 63c2ffdb..ac90c3ec 100644 --- a/test/unit/tsconfig-paths-conflicting-external/output.js +++ b/test/unit/tsconfig-paths-conflicting-external/output.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/tsconfig-paths/output-coverage.js b/test/unit/tsconfig-paths/output-coverage.js index ec7119cc..1954f5cd 100644 --- a/test/unit/tsconfig-paths/output-coverage.js +++ b/test/unit/tsconfig-paths/output-coverage.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; diff --git a/test/unit/tsconfig-paths/output.js b/test/unit/tsconfig-paths/output.js index 8441f154..6fb09a3c 100644 --- a/test/unit/tsconfig-paths/output.js +++ b/test/unit/tsconfig-paths/output.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true;