Skip to content

unbundle: true causes missing export #256

Description

@altano

Reproduction link or steps

https://stackblitz.com/edit/github-yuanb3ht?file=dist%2FTextMeasurer%2FBrowserTextMeasurer.js

This file, dist/TextMeasurer/BrowserTextMeasurer.js, has no exports:

import { TextMeasurer } from "./TextMeasurer.js";

//#region src/TextMeasurer/BrowserTextMeasurer.ts
var BrowserTextMeasurer = class extends TextMeasurer {
	async getDimensions(fontSize) {
		return {
			width: 1,
			height: 1
		};
	}
};

//#endregion

This only happens when unbundle: true is used. When unbundle: false, the file has an export:

//#region src/TextMeasurer/TextMeasurer.ts
var TextMeasurer = class {};

//#endregion
//#region src/TextMeasurer/BrowserTextMeasurer.ts
var BrowserTextMeasurer = class extends TextMeasurer {
	async getDimensions(fontSize) {
		return {
			width: 1,
			height: 1
		};
	}
};

//#endregion
export { BrowserTextMeasurer as default };

NOTE: the reason this is probably happening is some bad interplay between unbundle: true and the fact that this file is only dynamically imported (const Measurer = await import('./BrowserTextMeasurer.js');)

What is expected?

I would expect both the bundled and unbundled versions to have exports in this file

What is actually happening?

There is no export for BrowserTextMeasurer in the output files

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions