mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
fix(cli/lsp): fix using jsx/tsx when not emitting via tsc (#9407)
Closes #9308 Closes #9023 Closes #8993
This commit is contained in:
parent
923214c537
commit
5b9376908a
4 changed files with 18 additions and 1 deletions
|
@ -431,8 +431,10 @@ impl Inner {
|
|||
let mark = self.performance.mark("update_tsconfig");
|
||||
let mut tsconfig = TsConfig::new(json!({
|
||||
"allowJs": true,
|
||||
"esModuleInterop": true,
|
||||
"experimentalDecorators": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "react",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"module": "esnext",
|
||||
"noEmit": true,
|
||||
|
|
|
@ -799,6 +799,7 @@ impl Graph {
|
|||
// Enabled by default to align to transpile/swc defaults
|
||||
"experimentalDecorators": true,
|
||||
"incremental": true,
|
||||
"jsx": "react",
|
||||
"isolatedModules": true,
|
||||
"lib": options.lib,
|
||||
"module": "esnext",
|
||||
|
@ -811,7 +812,6 @@ impl Graph {
|
|||
// TODO(@kitsonk) consider enabling this by default
|
||||
// see: https://github.com/denoland/deno/issues/7732
|
||||
"emitDecoratorMetadata": false,
|
||||
"jsx": "react",
|
||||
"inlineSourceMap": true,
|
||||
"outDir": "deno://",
|
||||
"removeComments": true,
|
||||
|
|
10
cli/tests/bundle_jsx.out
Normal file
10
cli/tests/bundle_jsx.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
[WILDCARD]
|
||||
const React = {
|
||||
createElement () {
|
||||
}
|
||||
};
|
||||
function app() {
|
||||
return React.createElement("div", null, React.createElement("h2", null, "asdf"));
|
||||
}
|
||||
console.log(app);
|
||||
|
|
@ -2702,6 +2702,11 @@ console.log("finish");
|
|||
output: "bundle.test.out",
|
||||
});
|
||||
|
||||
itest!(bundle_jsx {
|
||||
args: "bundle jsx_import_from_ts.ts",
|
||||
output: "bundle_jsx.out",
|
||||
});
|
||||
|
||||
itest!(fmt_check_tests_dir {
|
||||
args: "fmt --check ./",
|
||||
output: "fmt/expected_fmt_check_tests_dir.out",
|
||||
|
|
Loading…
Reference in a new issue