mirror of
https://github.com/denoland/deno.git
synced 2024-11-29 16:30:56 -05:00
fix(cli/tsc): allow non-standard extensions on imports (#8464)
This commit is contained in:
parent
e3f73d3ec0
commit
e7fc7d7151
4 changed files with 17 additions and 3 deletions
2
cli/tests/075_import_local_query_hash.ts
Normal file
2
cli/tests/075_import_local_query_hash.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import "./001_hello.js?a=b#c";
|
||||||
|
import "./002_hello.ts?a=b#c";
|
2
cli/tests/075_import_local_query_hash.ts.out
Normal file
2
cli/tests/075_import_local_query_hash.ts.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[WILDCARD]Hello World
|
||||||
|
Hello World
|
|
@ -2418,6 +2418,11 @@ itest!(_074_worker_nested_error {
|
||||||
exit_code: 1,
|
exit_code: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
itest!(_075_import_local_query_hash {
|
||||||
|
args: "run 075_import_local_query_hash.ts",
|
||||||
|
output: "075_import_local_query_hash.ts.out",
|
||||||
|
});
|
||||||
|
|
||||||
itest!(js_import_detect {
|
itest!(js_import_detect {
|
||||||
args: "run --quiet --reload js_import_detect.ts",
|
args: "run --quiet --reload js_import_detect.ts",
|
||||||
output: "js_import_detect.ts.out",
|
output: "js_import_detect.ts.out",
|
||||||
|
|
|
@ -309,6 +309,11 @@ delete Object.prototype.__proto__;
|
||||||
|
|
||||||
const { options, errors: configFileParsingDiagnostics } = ts
|
const { options, errors: configFileParsingDiagnostics } = ts
|
||||||
.convertCompilerOptionsFromJson(config, "", "tsconfig.json");
|
.convertCompilerOptionsFromJson(config, "", "tsconfig.json");
|
||||||
|
// The `allowNonTsExtensions` is a "hidden" compiler option used in VSCode
|
||||||
|
// which is not allowed to be passed in JSON, we need it to allow special
|
||||||
|
// URLs which Deno supports. So we need to either ignore the diagnostic, or
|
||||||
|
// inject it ourselves.
|
||||||
|
Object.assign(options, { allowNonTsExtensions: true });
|
||||||
const program = ts.createIncrementalProgram({
|
const program = ts.createIncrementalProgram({
|
||||||
rootNames,
|
rootNames,
|
||||||
options,
|
options,
|
||||||
|
|
Loading…
Reference in a new issue