-
-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#1101) * Fix #905 Ensure that json files are resolved if resolveJsonModule flag is set in tsconfig * Add test * PR Comments
- Loading branch information
1 parent
bbc6d81
commit 227d99a
Showing
11 changed files
with
57 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as file from "./file.json"; | ||
|
||
console.log(file.foo); |
1 change: 1 addition & 0 deletions
1
test/comparison-tests/resolveJsonModule/expectedOutput-3.8/bundle.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
test/comparison-tests/resolveJsonModule/expectedOutput-3.8/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,10 @@ | ||
Asset Size Chunks Chunk Names | ||
bundle.js 1 KiB 0 [emitted] main | ||
../app.d.ts 11 bytes [emitted] | ||
Entrypoint main = bundle.js | ||
[0] ./app.ts 99 bytes {0} [built] | ||
[1] ./file.json 18 bytes {0} [built] | ||
|
||
WARNING in configuration | ||
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. | ||
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ |
1 change: 1 addition & 0 deletions
1
test/comparison-tests/resolveJsonModule/expectedOutput-transpile-3.8/bundle.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
test/comparison-tests/resolveJsonModule/expectedOutput-transpile-3.8/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,9 @@ | ||
Asset Size Chunks Chunk Names | ||
bundle.js 1.03 KiB 0 [emitted] main | ||
Entrypoint main = bundle.js | ||
[0] ./app.ts 135 bytes {0} [built] | ||
[1] ./file.json 18 bytes {0} [built] | ||
|
||
WARNING in configuration | ||
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. | ||
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ |
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 @@ | ||
{ | ||
"foo": "bar" | ||
} |
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,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"resolveJsonModule": true, | ||
"composite": true | ||
}, | ||
"include": ["app.ts", "file.json"] | ||
} |
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 @@ | ||
module.exports = { | ||
entry: './app.ts', | ||
output: { | ||
filename: 'bundle.js' | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.json'] | ||
}, | ||
module: { | ||
rules: [{ test: /\.tsx?$/, loader: 'ts-loader' }] | ||
} | ||
}; |