Skip to content

swc.minify with sourcemap issue #10108

@Skrypt

Description

@Skrypt

Describe the bug

I am using swc.minify() API method to minify files.
Though, the sourcemap generated is different when used under Windows or under Linux.
Also, the .map files generates with \r\n newlines on Windows and \n newlines on Linux.
I needed to add code to rewrite the files with \n which is an ugly patch for now.
But the main issue is that the .map files are generated with different output when minified under Windows vs Linux.

Input code

You can find the code used here: https://github.com/OrchardCMS/OrchardCore/blob/main/.scripts/assets-manager/min.mjs

Config

    {
        compress: true,
        sourceMap: true,
    }

Playground link (or link to the minimal reproduction)

OrchardCMS/OrchardCore#17533

SWC Info output

No response

Expected behavior

Should output the same from Windows or Linux

Actual behavior

No response

Version

1.11.1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions