oops typescript

Former-commit-id: 7c400c9b24
This commit is contained in:
Jarred Sumner
2021-06-04 19:30:08 -07:00
parent faa3c867e2
commit 9dc7f25825
2 changed files with 7 additions and 3 deletions

View File

@@ -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);

View File

@@ -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,
);
}