Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcemaps (+possible implementation) #47

Open
OleksandrDemian opened this issue Jul 21, 2022 · 4 comments
Open

Sourcemaps (+possible implementation) #47

OleksandrDemian opened this issue Jul 21, 2022 · 4 comments

Comments

@OleksandrDemian
Copy link

It would be great to add sourcemaps support to this project. I think it should be possible to do it using magic-string (npm link).

The implementation might look like this:

        // ... transform code
        const res = await transformWithEsbuild(componentCode, id, {
          loader: 'jsx',
          ...esbuildOptions,
        })

        return {
          code: res.code,
          map: new MagicString(res.code).generateMap({
            source: id,
          }),
        }
@OleksandrDemian OleksandrDemian changed the title Sourcemaps (+ possible implementation) Sourcemaps (+possible implementation) Jul 21, 2022
@pd4d10
Copy link
Owner

pd4d10 commented Jul 22, 2022

Looks great! Would you like to submit a PR?

@OleksandrDemian
Copy link
Author

Yes, I'm not sure if this code actually works, I will run a couple of tests, and in case of success I will open the PR.

@CodiBurley
Copy link

Yes, I'm not sure if this code actually works, I will run a couple of tests, and in case of success I will open the PR.

Did you ever test this out?

@OleksandrDemian
Copy link
Author

@CodiBurley yes, but it doesn't seem to have any impact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants