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

Source Maps Contain No Information #60

Closed
Pugio opened this issue Nov 30, 2016 · 4 comments · Fixed by #97
Closed

Source Maps Contain No Information #60

Pugio opened this issue Nov 30, 2016 · 4 comments · Fixed by #97
Labels

Comments

@Pugio
Copy link

Pugio commented Nov 30, 2016

HelloWorld.html:

<h1>Hello {{name}}</h1>

{{#if x > 10}}
  <p>{{x}} is greater than 10</p>
{{elseif 5 > x}}
  <p>{{x}} is less than 5</p>
{{else}}
  <p>{{x}} is between 5 and 10</p>
{{/if}}

<script>
  export default {
    data () {
      return {
        count: 0
      };
    }
  };
</script>

svelte compile -m --format iife HelloWorld.html -o out.js

out.js.map:

{"version":3,"file":null,"sources":[],"sourcesContent":[],"names":[],"mappings":";;,,;;;;;;;;,;;;;;;;;,,;;;;;;;;;;;;;;,,;;;;;;;;,,;;,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,;;;;;;;;,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,;;;;;;;;;;;;;,,;;;;;;;;;;;;;;;;;;;;;,,;;;;;;;;;;;;;,,;;;;;;;;;;;;;;;;;;,,;;;;;;;;;;,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,;;;;"}

I haven't dealt with sourcemaps much in the past, but shouldn't some of those fields contain file information, and shouldn't mappings contain some data between the ; and , ?

@Rich-Harris
Copy link
Member

Good point! Sourcemaps were working well at one point but I must have broken them because I didn't add any tests. [slaps self on wrist] I think I know where it broke...

@Pugio
Copy link
Author

Pugio commented Nov 30, 2016

Great, thanks! I was working on integrating this into the Rails asset pipeline.

@TehShrike
Copy link
Member

Somewhat related: would you be willing to pass includeContent: true to generateMap here in generate/index.js? And/or add an option to pass to compile to enable including content?

@Rich-Harris
Copy link
Member

@TehShrike yeah, that makes sense. FYI am working on sourcemaps right now, so hopefully this'll all be up and running soon

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

Successfully merging a pull request may close this issue.

3 participants