-
-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #399 from johnnyreilly/master
Introduce meaningful error when importing TypeScript
- Loading branch information
Showing
40 changed files
with
339 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../expectedOutput-2.0/output.transpiled.txt → .../expectedOutput-2.0/output.transpiled.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Asset Size Chunks Chunk Names | ||
bundle.js 1.43 kB 0 [emitted] main | ||
chunk {0} bundle.js (main) 38 bytes [rendered] | ||
[0] ./.test/allowJs/src/index.js 38 bytes {0} [built] | ||
[0] ./.test/allowJs-entryFileIsJs/src/index.js 38 bytes {0} [built] |
2 changes: 1 addition & 1 deletion
2
...sts/allowJs/expectedOutput-2.0/output.txt → ...tryFileIsJs/expectedOutput-2.0/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Asset Size Chunks Chunk Names | ||
bundle.js 1.41 kB 0 [emitted] main | ||
chunk {0} bundle.js (main) 24 bytes [rendered] | ||
[0] ./.test/allowJs/src/index.js 24 bytes {0} [built] | ||
[0] ./.test/allowJs-entryFileIsJs/src/index.js 24 bytes {0} [built] |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../expectedOutput-2.1/output.transpiled.txt → .../expectedOutput-2.1/output.transpiled.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Asset Size Chunks Chunk Names | ||
bundle.js 1.43 kB 0 [emitted] main | ||
chunk {0} bundle.js (main) 38 bytes [rendered] | ||
[0] ./.test/allowJs/src/index.js 38 bytes {0} [built] | ||
[0] ./.test/allowJs-entryFileIsJs/src/index.js 38 bytes {0} [built] |
2 changes: 1 addition & 1 deletion
2
...sts/allowJs/expectedOutput-2.1/output.txt → ...tryFileIsJs/expectedOutput-2.1/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Asset Size Chunks Chunk Names | ||
bundle.js 1.41 kB 0 [emitted] main | ||
chunk {0} bundle.js (main) 24 bytes [rendered] | ||
[0] ./.test/allowJs/src/index.js 24 bytes {0} [built] | ||
[0] ./.test/allowJs-entryFileIsJs/src/index.js 24 bytes {0} [built] |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ module.exports = { | |
loader: 'ts-loader' | ||
} | ||
] | ||
}, | ||
ts: { | ||
entryFileIsJs: true | ||
} | ||
} | ||
|
||
|
3 changes: 3 additions & 0 deletions
3
test/comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import a = require('a'); | ||
|
||
console.log(a); |
53 changes: 53 additions & 0 deletions
53
test/comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-2.0/bundle.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
|
||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
|
||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
|
||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
|
||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
|
||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
|
||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
|
||
|
||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
|
||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
|
||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
|
||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
"use strict"; | ||
var a = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"a\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); | ||
console.log(a); | ||
|
||
|
||
/***/ } | ||
/******/ ]); |
62 changes: 62 additions & 0 deletions
62
...n-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-2.0/bundle.transpiled.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
|
||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
|
||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
|
||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
|
||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
|
||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
|
||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
|
||
|
||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
|
||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
|
||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
|
||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
"use strict"; | ||
var a = __webpack_require__(1); | ||
console.log(a); | ||
|
||
|
||
/***/ }, | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
|
||
"use strict"; | ||
var elephant = "In the room"; | ||
module.exports = elephant; | ||
|
||
|
||
/***/ } | ||
/******/ ]); |
5 changes: 5 additions & 0 deletions
5
...-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-2.0/output.transpiled.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Asset Size Chunks Chunk Names | ||
bundle.js 1.6 kB 0 [emitted] main | ||
chunk {0} bundle.js (main) 123 bytes [rendered] | ||
[0] ./.test/nodeModulesMeaningfulErrorWhenImportingTs/app.ts 52 bytes {0} [built] | ||
[1] ./.test/nodeModulesMeaningfulErrorWhenImportingTs/~/a/index.ts 71 bytes {0} [built] |
12 changes: 12 additions & 0 deletions
12
.../comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-2.0/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Asset Size Chunks Chunk Names | ||
bundle.js 1.6 kB 0 [emitted] main | ||
chunk {0} bundle.js (main) 52 bytes [rendered] | ||
[0] ./.test/nodeModulesMeaningfulErrorWhenImportingTs/app.ts 52 bytes {0} [built] [1 error] | ||
|
||
ERROR in ./.test/nodeModulesMeaningfulErrorWhenImportingTs/~/a/index.ts | ||
Module build failed: Error: Typescript emitted no output for node_modules\a\index.ts. | ||
You should not need to recompile .ts files in node_modules. | ||
Please contact the package author to advise them to use --declaration --outDir. | ||
More https://github.com/Microsoft/TypeScript/issues/12358 | ||
at Object.loader (dist\index.js:30:15) | ||
@ ./.test/nodeModulesMeaningfulErrorWhenImportingTs/app.ts 2:8-20 |
53 changes: 53 additions & 0 deletions
53
test/comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-2.1/bundle.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
|
||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
|
||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
|
||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
|
||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
|
||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
|
||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
|
||
|
||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
|
||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
|
||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
|
||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
"use strict"; | ||
var a = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"a\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); | ||
console.log(a); | ||
|
||
|
||
/***/ } | ||
/******/ ]); |
Oops, something went wrong.