Svelte: Source Maps Contain No Information

Created on 30 Nov 2016  路  4Comments  路  Source: sveltejs/svelte

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 , ?

bug

Most helpful comment

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

All 4 comments

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...

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

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?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

plumpNation picture plumpNation  路  3Comments

Rich-Harris picture Rich-Harris  路  3Comments

sskyy picture sskyy  路  3Comments

robnagler picture robnagler  路  3Comments

AntoninBeaufort picture AntoninBeaufort  路  3Comments