diff options
author | 2021-06-04 19:30:08 -0700 | |
---|---|---|
committer | 2021-06-04 19:30:08 -0700 | |
commit | 9dc7f258259e95fcdb1d5d7d3db0a41992efa79e (patch) | |
tree | 3c19d288019cfd64613f4c6795fb1bc8632119ea /src | |
parent | faa3c867e21c3af023b584c1798b09e947a21670 (diff) | |
download | bun-9dc7f258259e95fcdb1d5d7d3db0a41992efa79e.tar.gz bun-9dc7f258259e95fcdb1d5d7d3db0a41992efa79e.tar.zst bun-9dc7f258259e95fcdb1d5d7d3db0a41992efa79e.zip |
oops typescript
Former-commit-id: 7c400c9b248c2e4c9e07270d1c23a370cfd5f660
Diffstat (limited to 'src')
-rw-r--r-- | src/bundler.zig | 8 | ||||
-rw-r--r-- | src/cli.zig | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/bundler.zig b/src/bundler.zig index 2e8c0133c..aa630e2e0 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -227,7 +227,7 @@ pub fn NewBundler(cache_files: bool) type { file_path.pretty = Linker.relative_paths_list.append(bundler.fs.relativeTo(file_path.text)) catch unreachable; switch (loader) { - .jsx, .tsx, .js, .json => { + .jsx, .tsx, .js, .ts, .json => { var result = bundler.parse(bundler.allocator, file_path, loader, resolve_result.dirname_fd) orelse { js_ast.Expr.Data.Store.reset(); js_ast.Stmt.Data.Store.reset(); @@ -314,7 +314,11 @@ pub fn NewBundler(cache_files: bool) type { const source = logger.Source.initFile(Fs.File{ .path = path, .contents = entry.contents }, bundler.allocator) catch return null; switch (loader) { - .js, .jsx, .ts, .tsx => { + .js, + .jsx, + .ts, + .tsx, + => { var jsx = bundler.options.jsx; jsx.parse = loader.isJSX(); var opts = js_parser.Parser.Options.init(jsx, loader); diff --git a/src/cli.zig b/src/cli.zig index a69ac8833..cdf71b568 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -344,7 +344,7 @@ pub const Cli = struct { for (result.output_files) |f, i| { max_path_len = std.math.max( - f.input.text[from_path.len..].len + 2, + std.math.max(from_path.len, f.input.text.len) + 2 - from_path.len, max_path_len, ); } |