diff options
-rw-r--r-- | cli/lsp/language_server.rs | 2 | ||||
-rw-r--r-- | cli/module_graph.rs | 2 | ||||
-rw-r--r-- | cli/tests/bundle_jsx.out | 10 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 5 |
4 files changed, 18 insertions, 1 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index d7d034db0..fa613f696 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -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, diff --git a/cli/module_graph.rs b/cli/module_graph.rs index e7222289c..5d1e514d0 100644 --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -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, diff --git a/cli/tests/bundle_jsx.out b/cli/tests/bundle_jsx.out new file mode 100644 index 000000000..44c9e4555 --- /dev/null +++ b/cli/tests/bundle_jsx.out @@ -0,0 +1,10 @@ +[WILDCARD] +const React = { + createElement () { + } +}; +function app() { + return React.createElement("div", null, React.createElement("h2", null, "asdf")); +} +console.log(app); + diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index b158c9b55..dd6b740e3 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -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", |