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

JavaScript source maps contain incorrect URL #114

Closed
valtlai opened this issue Jun 23, 2021 · 0 comments
Closed

JavaScript source maps contain incorrect URL #114

valtlai opened this issue Jun 23, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@valtlai
Copy link
Contributor

valtlai commented Jun 23, 2021

Source maps generated by the Terser plugin have an incorrect URL 0 in the sources array.

A test case:

  • _config.js:

    import lume from "lume/mod.js";
    import terser from "lume/plugins/terser.js";
    
    const site = lume()
      .use(terser({ sourceMap: true }));
    
    export default site;
  • index.njk:

    <script src="/foo.js"></script>
  • foo.js:

    console.log("Test!");

That results the following source map:

  • foo.js.map:

    {"version":3,"sources":["0"],"names":["console","log"],"mappings":"AAAAA,QAAQC,IAAI","file":"/foo.js"}

    Should have foo.js instead of 0.


Edit: The issue originally covered the PostCSS plugin too, but I think its source maps are correct after all.

@valtlai valtlai added the bug Something isn't working label Jun 23, 2021
@valtlai valtlai changed the title Source maps contain incorrect URLs JavaScript source maps contain incorrect URLs Jun 23, 2021
@valtlai valtlai changed the title JavaScript source maps contain incorrect URLs JavaScript source maps contain incorrect URL Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant