From b3968ae662265f1957b88d1579b108544ee1fe72 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Tue, 8 Nov 2016 23:31:01 -0700 Subject: [PATCH 1/4] add new test --- .../node_modules-subdir/app.ts | 2 + .../expectedOutput-2.0/.DS_Store | Bin 0 -> 6148 bytes .../expectedOutput-2.0/bundle.js | 52 +++++++++++++++++ .../expectedOutput-2.0/bundle.transpiled.js | 53 ++++++++++++++++++ .../expectedOutput-2.0/output.transpiled.txt | 4 ++ .../expectedOutput-2.0/output.txt | 7 +++ .../node_modules-subdir/tsconfig.json | 5 ++ .../node_modules-subdir/webpack.config.js | 17 ++++++ 8 files changed, 140 insertions(+) create mode 100644 test/comparison-tests/node_modules-subdir/app.ts create mode 100644 test/comparison-tests/node_modules-subdir/expectedOutput-2.0/.DS_Store create mode 100644 test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js create mode 100644 test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.transpiled.js create mode 100644 test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.transpiled.txt create mode 100644 test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt create mode 100644 test/comparison-tests/node_modules-subdir/tsconfig.json create mode 100644 test/comparison-tests/node_modules-subdir/webpack.config.js diff --git a/test/comparison-tests/node_modules-subdir/app.ts b/test/comparison-tests/node_modules-subdir/app.ts new file mode 100644 index 000000000..f584fba64 --- /dev/null +++ b/test/comparison-tests/node_modules-subdir/app.ts @@ -0,0 +1,2 @@ +({get x(){ return 1 }}) +Symbol \ No newline at end of file diff --git a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/.DS_Store b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b6062f7aa0f0fd1f225901533b3992f7c466830e GIT binary patch literal 6148 zcmeHK!AiqG5Pg$YX!X*Af)^o2FD;0ucnhV9z3M^mAllZ060F!1Jmv%a0RN`G*&R#U z)TzwvO8j|V)fuf`?)a2AX$V0VR4;2n>wFu@z1LzU6bd$3gJbEVE6 z#+XWwFZay14?bfGe=U3UJL)2MS%F&Ywsif!_2-NawzgJoPS@I${y Date: Tue, 8 Nov 2016 23:51:25 -0700 Subject: [PATCH 2/4] let it pass --- test/comparison-tests/node_modules-subdir/app.ts | 4 ++-- .../expectedOutput-2.0/.DS_Store | Bin 6148 -> 0 bytes .../expectedOutput-2.0/bundle.js | 4 ++-- .../expectedOutput-2.0/bundle.transpiled.js | 5 ++--- .../expectedOutput-2.0/output.transpiled.txt | 6 +++--- .../expectedOutput-2.0/output.txt | 9 +++------ .../node_modules/foo/bar/index.ts | 1 + .../node_modules/foo/package.json | 12 ++++++++++++ 8 files changed, 25 insertions(+), 16 deletions(-) delete mode 100644 test/comparison-tests/node_modules-subdir/expectedOutput-2.0/.DS_Store create mode 100644 test/comparison-tests/node_modules-subdir/node_modules/foo/bar/index.ts create mode 100644 test/comparison-tests/node_modules-subdir/node_modules/foo/package.json diff --git a/test/comparison-tests/node_modules-subdir/app.ts b/test/comparison-tests/node_modules-subdir/app.ts index f584fba64..71696d773 100644 --- a/test/comparison-tests/node_modules-subdir/app.ts +++ b/test/comparison-tests/node_modules-subdir/app.ts @@ -1,2 +1,2 @@ -({get x(){ return 1 }}) -Symbol \ No newline at end of file +// import * as bar from "foo/bar" +// console.log(bar) \ No newline at end of file diff --git a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/.DS_Store b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/.DS_Store deleted file mode 100644 index b6062f7aa0f0fd1f225901533b3992f7c466830e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!AiqG5Pg$YX!X*Af)^o2FD;0ucnhV9z3M^mAllZ060F!1Jmv%a0RN`G*&R#U z)TzwvO8j|V)fuf`?)a2AX$V0VR4;2n>wFu@z1LzU6bd$3gJbEVE6 z#+XWwFZay14?bfGe=U3UJL)2MS%F&Ywsif!_2-NawzgJoPS@I${y Date: Tue, 8 Nov 2016 23:52:11 -0700 Subject: [PATCH 3/4] still pass --- test/comparison-tests/node_modules-subdir/app.ts | 2 +- .../node_modules-subdir/expectedOutput-2.0/bundle.js | 2 +- .../node_modules-subdir/expectedOutput-2.0/output.txt | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/comparison-tests/node_modules-subdir/app.ts b/test/comparison-tests/node_modules-subdir/app.ts index 71696d773..26a2581bd 100644 --- a/test/comparison-tests/node_modules-subdir/app.ts +++ b/test/comparison-tests/node_modules-subdir/app.ts @@ -1,2 +1,2 @@ -// import * as bar from "foo/bar" +import * as bar from "foo/bar" // console.log(bar) \ No newline at end of file diff --git a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js index 7e741bce2..f06a2bca9 100644 --- a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js +++ b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js @@ -44,7 +44,7 @@ /* 0 */ /***/ function(module, exports) { - // import * as bar from "foo/bar" + "use strict"; // console.log(bar) diff --git a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt index ac68134a2..235f46ec3 100644 --- a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt +++ b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt @@ -1,4 +1,4 @@ Asset Size Chunks Chunk Names -bundle.js 1.44 kB 0 [emitted] main -chunk {0} bundle.js (main) 55 bytes [rendered] - [0] ./.test/node_modules-subdir/app.ts 55 bytes {0} [built] \ No newline at end of file +bundle.js 1.42 kB 0 [emitted] main +chunk {0} bundle.js (main) 35 bytes [rendered] + [0] ./.test/node_modules-subdir/app.ts 35 bytes {0} [built] \ No newline at end of file From 363180cd6e96bf697d0045f8d1594932f9b0a887 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Tue, 8 Nov 2016 23:53:58 -0700 Subject: [PATCH 4/4] Look at output.txt and you see an error. This error needs to be *gone* :) --- test/comparison-tests/node_modules-subdir/app.ts | 2 +- .../expectedOutput-2.0/bundle.js | 5 +++-- .../expectedOutput-2.0/bundle.transpiled.js | 13 +++++++++++-- .../expectedOutput-2.0/output.transpiled.txt | 7 ++++--- .../expectedOutput-2.0/output.txt | 11 ++++++++--- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/test/comparison-tests/node_modules-subdir/app.ts b/test/comparison-tests/node_modules-subdir/app.ts index 26a2581bd..efd8ba5a8 100644 --- a/test/comparison-tests/node_modules-subdir/app.ts +++ b/test/comparison-tests/node_modules-subdir/app.ts @@ -1,2 +1,2 @@ import * as bar from "foo/bar" -// console.log(bar) \ No newline at end of file +console.log(bar) \ No newline at end of file diff --git a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js index f06a2bca9..82fa821e0 100644 --- a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js +++ b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.js @@ -42,10 +42,11 @@ /************************************************************************/ /******/ ([ /* 0 */ -/***/ function(module, exports) { +/***/ function(module, exports, __webpack_require__) { "use strict"; - // console.log(bar) + var bar = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"foo/bar\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + console.log(bar); /***/ } diff --git a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.transpiled.js b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.transpiled.js index 5455b2678..fe782200b 100644 --- a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.transpiled.js +++ b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/bundle.transpiled.js @@ -42,10 +42,19 @@ /************************************************************************/ /******/ ([ /* 0 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var bar = __webpack_require__(1); + console.log(bar); + + +/***/ }, +/* 1 */ /***/ function(module, exports) { - "use strict";// import * as bar from "foo/bar" - // console.log(bar) + "use strict"; + exports.bar = "sample"; /***/ } diff --git a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.transpiled.txt b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.transpiled.txt index e7d5e42cd..e1150ce03 100644 --- a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.transpiled.txt +++ b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.transpiled.txt @@ -1,4 +1,5 @@ Asset Size Chunks Chunk Names -bundle.js 1.46 kB 0 [emitted] main -chunk {0} bundle.js (main) 68 bytes [rendered] - [0] ./.test/node_modules-subdir/app.ts 68 bytes {0} [built] \ No newline at end of file +bundle.js 1.57 kB 0 [emitted] main +chunk {0} bundle.js (main) 100 bytes [rendered] + [0] ./.test/node_modules-subdir/app.ts 62 bytes {0} [built] + [1] ./.test/node_modules-subdir/~/foo/bar/index.ts 38 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt index 235f46ec3..a7b67e94e 100644 --- a/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt +++ b/test/comparison-tests/node_modules-subdir/expectedOutput-2.0/output.txt @@ -1,4 +1,9 @@ Asset Size Chunks Chunk Names -bundle.js 1.42 kB 0 [emitted] main -chunk {0} bundle.js (main) 35 bytes [rendered] - [0] ./.test/node_modules-subdir/app.ts 35 bytes {0} [built] \ No newline at end of file +bundle.js 1.61 kB 0 [emitted] main +chunk {0} bundle.js (main) 62 bytes [rendered] + [0] ./.test/node_modules-subdir/app.ts 62 bytes {0} [built] [1 error] + +ERROR in ./.test/node_modules-subdir/~/foo/bar/index.ts +Module build failed: Error: Typescript emitted no output for node_modules/foo/bar/index.ts + at Object.loader (dist/index.js:27:15) + @ ./.test/node_modules-subdir/app.ts 2:10-28 \ No newline at end of file