diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-02-15 08:05:29 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-02-15 11:05:29 -0500 |
commit | fe0ceae54373c0e12b36111b886a06c800f86c20 (patch) | |
tree | f3bc3c81e1623eeaa5e00b54ef367826cecda75f | |
parent | 2241049c349443a971ba2558f373d62bbb7d9780 (diff) |
Fix behavior for extensionless files with .mime file (#1779)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | js/compiler.ts | 1 | ||||
-rw-r--r-- | rollup.config.js | 5 | ||||
-rw-r--r-- | tests/023_no_ext_with_mime | 1 | ||||
-rw-r--r-- | tests/023_no_ext_with_mime.mime | 1 | ||||
-rw-r--r-- | tests/023_no_ext_with_mime.out | 1 | ||||
-rw-r--r-- | tests/023_no_ext_with_mime.test | 2 | ||||
-rw-r--r-- | tests/024_import_no_ext_with_mime.test | 2 | ||||
-rw-r--r-- | tests/024_import_no_ext_with_mime.ts | 1 | ||||
-rw-r--r-- | tests/024_import_no_ext_with_mime.ts.out | 1 |
10 files changed, 14 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore index 0199a212b..0dd8e57e4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ yarn.lock node_modules # editor files .idea +.vscode # export dir for gh-pages /gh-pages # temp benchmark data diff --git a/js/compiler.ts b/js/compiler.ts index fa865de43..4ffef30fc 100644 --- a/js/compiler.ts +++ b/js/compiler.ts @@ -162,6 +162,7 @@ class Compiler implements ts.LanguageServiceHost, ts.FormatDiagnosticsHost { // arguments private readonly _options: ts.CompilerOptions = { allowJs: true, + allowNonTsExtensions: true, checkJs: true, esModuleInterop: true, module: ts.ModuleKind.ESNext, diff --git a/rollup.config.js b/rollup.config.js index 30d03bd77..5bfab06d9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -266,11 +266,12 @@ export default function makeConfig(commandOptions) { "createLanguageService", "formatDiagnostics", "formatDiagnosticsWithColorAndContext", + "version", + "Extension", "ModuleKind", "ScriptKind", "ScriptSnapshot", - "ScriptTarget", - "version" + "ScriptTarget" ] } }), diff --git a/tests/023_no_ext_with_mime b/tests/023_no_ext_with_mime new file mode 100644 index 000000000..87951d835 --- /dev/null +++ b/tests/023_no_ext_with_mime @@ -0,0 +1 @@ +console.log("HELLO"); diff --git a/tests/023_no_ext_with_mime.mime b/tests/023_no_ext_with_mime.mime new file mode 100644 index 000000000..d7482e1bc --- /dev/null +++ b/tests/023_no_ext_with_mime.mime @@ -0,0 +1 @@ +application/javascript
\ No newline at end of file diff --git a/tests/023_no_ext_with_mime.out b/tests/023_no_ext_with_mime.out new file mode 100644 index 000000000..e427984d4 --- /dev/null +++ b/tests/023_no_ext_with_mime.out @@ -0,0 +1 @@ +HELLO diff --git a/tests/023_no_ext_with_mime.test b/tests/023_no_ext_with_mime.test new file mode 100644 index 000000000..4a830aab7 --- /dev/null +++ b/tests/023_no_ext_with_mime.test @@ -0,0 +1,2 @@ +args: tests/023_no_ext_with_mime --reload --recompile +output: tests/023_no_ext_with_mime.out diff --git a/tests/024_import_no_ext_with_mime.test b/tests/024_import_no_ext_with_mime.test new file mode 100644 index 000000000..03bb6df93 --- /dev/null +++ b/tests/024_import_no_ext_with_mime.test @@ -0,0 +1,2 @@ +args: tests/024_import_no_ext_with_mime.ts --reload --recompile +output: tests/024_import_no_ext_with_mime.ts.out diff --git a/tests/024_import_no_ext_with_mime.ts b/tests/024_import_no_ext_with_mime.ts new file mode 100644 index 000000000..d5140de66 --- /dev/null +++ b/tests/024_import_no_ext_with_mime.ts @@ -0,0 +1 @@ +import "./023_no_ext_with_mime"; diff --git a/tests/024_import_no_ext_with_mime.ts.out b/tests/024_import_no_ext_with_mime.ts.out new file mode 100644 index 000000000..e427984d4 --- /dev/null +++ b/tests/024_import_no_ext_with_mime.ts.out @@ -0,0 +1 @@ +HELLO |