Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable ts caching for typechecking #213

Merged
merged 2 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
};
4 changes: 2 additions & 2 deletions test/unit/ts-decl/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 679:
/***/ 138:
/***/ (function(__unusedmodule, exports) {

"use strict";
Expand All @@ -58,7 +58,7 @@ exports.test = test;

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(679);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(138);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_test_ts__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _test_ts__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _test_ts__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));

Expand Down
4 changes: 2 additions & 2 deletions test/unit/ts-decl/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ module.exports =

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(781);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(381);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_test_ts__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _test_ts__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _test_ts__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));



/***/ }),

/***/ 781:
/***/ 381:
/***/ (function(__unusedmodule, exports) {

"use strict";
Expand Down
16 changes: 8 additions & 8 deletions test/unit/tsconfig-paths-conflicting-external/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,30 @@ module.exports =
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(278);
/******/ return __webpack_require__(996);
/******/ })
/************************************************************************/
/******/ ({

/***/ 278:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
/***/ 271:
/***/ (function(__unusedmodule, exports) {

"use strict";

exports.__esModule = true;
var _module_1 = __webpack_require__(725);
console.log(_module_1["default"]);
exports["default"] = {};


/***/ }),

/***/ 725:
/***/ (function(__unusedmodule, exports) {
/***/ 996:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

exports.__esModule = true;
exports["default"] = {};
var _module_1 = __webpack_require__(271);
console.log(_module_1["default"]);


/***/ })
Expand Down
8 changes: 4 additions & 4 deletions test/unit/tsconfig-paths-conflicting-external/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ module.exports =
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(398);
/******/ return __webpack_require__(468);
/******/ })
/************************************************************************/
/******/ ({

/***/ 398:
/***/ 468:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

exports.__esModule = true;
var _module_1 = __webpack_require__(649);
var _module_1 = __webpack_require__(742);
console.log(_module_1["default"]);


/***/ }),

/***/ 649:
/***/ 742:
/***/ (function(__unusedmodule, exports) {

"use strict";
Expand Down
16 changes: 8 additions & 8 deletions test/unit/tsconfig-paths/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,30 @@ module.exports =
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(657);
/******/ return __webpack_require__(704);
/******/ })
/************************************************************************/
/******/ ({

/***/ 657:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
/***/ 455:
/***/ (function(__unusedmodule, exports) {

"use strict";

exports.__esModule = true;
var _module_1 = __webpack_require__(898);
console.log(_module_1["default"]);
exports["default"] = {};


/***/ }),

/***/ 898:
/***/ (function(__unusedmodule, exports) {
/***/ 704:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

exports.__esModule = true;
exports["default"] = {};
var _module_1 = __webpack_require__(455);
console.log(_module_1["default"]);


/***/ })
Expand Down
8 changes: 4 additions & 4 deletions test/unit/tsconfig-paths/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ module.exports =
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(308);
/******/ return __webpack_require__(650);
/******/ })
/************************************************************************/
/******/ ({

/***/ 308:
/***/ 650:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

exports.__esModule = true;
var _module_1 = __webpack_require__(341);
var _module_1 = __webpack_require__(851);
console.log(_module_1["default"]);


/***/ }),

/***/ 341:
/***/ 851:
/***/ (function(__unusedmodule, exports) {

"use strict";
Expand Down