Skip to content

Sources with no indented lines should be disregarded in bundle auto-indent #3

@Rich-Harris

Description

@Rich-Harris

Currently, a source that doesn't have any indented lines will be given the default indentStr of \t. When bundling several sources, tabs will therefore be over-represented - so in this situation...

// foo.js
export default 'this is foo';

// bar.js
export default 'this is bar';

// main.js
import foo from 'foo';
import bar from 'bar';

function logFoo () {
  console.log( foo );
}

function logBar () {
  console.log( bar );
}

...the bundle will incorrectly assume that tabs should be used, instead of two spaces

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions