Skip to content

esbuild: .ts imports aren't transformed into .js #594

@scarf005

Description

@scarf005

Version

2.1.3

Platform

linux

What steps will reproduce the bug?

  1. initialize lume project with esbuild.
.
├── _config.ts
├── _site
│   ├── a.js
│   └── b.js
├── a.ts
├── b.ts
└── deno.json
  1. setup project as following:

_config.ts

import lume from "lume/mod.ts"
import esbuild from "lume/plugins/esbuild.ts"

const site = lume()

site.use(esbuild({
  extensions: [".tsx", ".ts"],
  options: {
    minify: false,
    keepNames: false,
    bundle: false,
    splitting: true,
  },
}))

export default site

a.ts

import { b } from "./b.ts"

console.log(b)

b.ts

export const b = 3
  1. run deno task build.

How often does it reproduce? Is there a required condition?

it always happens.

What is the expected behavior?

.ts extension in compiled output is converted to .js.

What do you see instead?

a.js

import { b } from "./b.ts";
console.log(b);

b.js

const b = 3;
export {
  b
};

output extension is unchanged './b.ts', thus fails to load in browser.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions