From b1aa7ca85dd0bec2a131fc80dfb21aa2a03e12d1 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Wed, 9 Jan 2019 20:45:54 +0200 Subject: [PATCH] disable ts caching for typechecking --- scripts/build.js | 1 + src/index.js | 3 +++ src/loaders/uncacheable.js | 4 ++++ 3 files changed, 8 insertions(+) create mode 100644 src/loaders/uncacheable.js diff --git a/scripts/build.js b/scripts/build.js index 0b4c92ce6..2709c027b 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -73,6 +73,7 @@ async function main() { writeFileSync(__dirname + "/../dist/ncc/loaders/relocate-loader.js", relocateLoader); writeFileSync(__dirname + "/../dist/ncc/loaders/shebang-loader.js", shebangLoader); writeFileSync(__dirname + "/../dist/ncc/loaders/ts-loader.js", tsLoader); + await copy(__dirname + "/../src/loaders/uncacheable.js", __dirname + "/../dist/ncc/loaders/uncacheable.js"); // copy typescript types await copy( diff --git a/src/index.js b/src/index.js index a31e76b16..5e0d90f1d 100644 --- a/src/index.js +++ b/src/index.js @@ -135,6 +135,9 @@ module.exports = ( { test: /\.tsx?$/, use: [{ + loader: __dirname + "/loaders/uncacheable.js" + }, + { loader: __dirname + "/loaders/ts-loader.js", options: { compilerOptions: { diff --git a/src/loaders/uncacheable.js b/src/loaders/uncacheable.js new file mode 100644 index 000000000..e82a34572 --- /dev/null +++ b/src/loaders/uncacheable.js @@ -0,0 +1,4 @@ +module.exports = function (input) { + this.cacheable(false); + return input; +}; \ No newline at end of file