-
Notifications
You must be signed in to change notification settings - Fork 292
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
Fix issue with TypeScript paths with allowJs
#470
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
dd0a059
Fix absolute imports of JS files using TypeScript
novascreen c904ed9
Add unit test for tsconfig paths with allowjs
novascreen a48bf1f
Align extensions for tsconfig-paths with webpack config
novascreen 9cd8306
Align extensions for tsconfig-paths with webpack config only if allowJs
novascreen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import module from '@module'; | ||
|
||
console.log(module); |
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 @@ | ||
export default {}; |
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,86 @@ | ||
module.exports = | ||
/******/ (function(modules, runtime) { // webpackBootstrap | ||
/******/ "use strict"; | ||
/******/ // 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] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ __webpack_require__.ab = __dirname + "/"; | ||
/******/ | ||
/******/ // the startup function | ||
/******/ function startup() { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(439); | ||
/******/ }; | ||
/******/ // initialize runtime | ||
/******/ runtime(__webpack_require__); | ||
/******/ | ||
/******/ // run startup | ||
/******/ return startup(); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ({ | ||
|
||
/***/ 306: | ||
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) { | ||
|
||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony default export */ __webpack_exports__["default"] = ({}); | ||
|
||
|
||
/***/ }), | ||
|
||
/***/ 439: | ||
/***/ (function(__unusedmodule, exports, __webpack_require__) { | ||
|
||
"use strict"; | ||
|
||
exports.__esModule = true; | ||
var _module_1 = __webpack_require__(306); | ||
console.log(_module_1["default"]); | ||
|
||
|
||
/***/ }) | ||
|
||
/******/ }, | ||
/******/ function(__webpack_require__) { // webpackRuntimeModules | ||
/******/ "use strict"; | ||
/******/ | ||
/******/ /* webpack/runtime/make namespace object */ | ||
/******/ !function() { | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = function(exports) { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ }(); | ||
/******/ | ||
/******/ } | ||
); |
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,66 @@ | ||
module.exports = | ||
/******/ (function(modules, runtime) { // webpackBootstrap | ||
/******/ "use strict"; | ||
/******/ // 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] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ __webpack_require__.ab = __dirname + "/"; | ||
/******/ | ||
/******/ // the startup function | ||
/******/ function startup() { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(468); | ||
/******/ }; | ||
/******/ | ||
/******/ // run startup | ||
/******/ return startup(); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ({ | ||
|
||
/***/ 17: | ||
/***/ (function() { | ||
|
||
eval("require")("@module"); | ||
|
||
|
||
/***/ }), | ||
|
||
/***/ 468: | ||
/***/ (function(__unusedmodule, exports, __webpack_require__) { | ||
|
||
"use strict"; | ||
|
||
exports.__esModule = true; | ||
var _module_1 = __webpack_require__(17); | ||
console.log(_module_1["default"]); | ||
|
||
|
||
/***/ }) | ||
|
||
/******/ }); |
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,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"baseUrl": ".", | ||
"paths": { | ||
"@*": ["./*"] | ||
}, | ||
"allowJs": true | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs mention that these should be the same.
Perhaps this should look for
allowJs
option before assigning the extensions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@styfle I believe I addressed both your suggestions, I did it in two steps, let me know if you want to keep the check against the tsconfig.json