Skip to content

Commit

Permalink
disable ts caching for typechecking
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 9, 2019
1 parent ae96fbb commit 4a84a7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const ncc = require("../src/index.js");
const { statSync, writeFileSync } = require("fs");
const { statSync, writeFileSync, readFileSync } = require("fs");
const { promisify } = require("util");
const { relative } = require("path");
const copy = promisify(require("copy"));
Expand Down Expand Up @@ -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);
writeFileSync(__dirname + "/../dist/ncc/loaders/uncacheable.js", readFileSync(__dirname + "/../src/loaders/uncacheable.js"));

// copy typescript types
await copy(
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ module.exports = (
{
test: /\.tsx?$/,
use: [{
loader: __dirname + "/loaders/uncacheable.js"
},
{
loader: __dirname + "/loaders/ts-loader.js",
options: {
compilerOptions: {
Expand Down
4 changes: 4 additions & 0 deletions src/loaders/uncacheable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = function (input) {
this.cacheable(false);
return input;
};

0 comments on commit 4a84a7d

Please # to comment.