Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Is source map working properly? #169

Closed
jongmoon opened this issue Aug 8, 2016 · 2 comments · Fixed by #192
Closed

Is source map working properly? #169

jongmoon opened this issue Aug 8, 2016 · 2 comments · Fixed by #192

Comments

@jongmoon
Copy link

jongmoon commented Aug 8, 2016

Hello,

I came to know this great tool for service worker. I've learned many thing by this tool. Thank you. :)
But I get to have question while using it.

For debugging I have used source-map that was built.

First I had a problem because of source map path in sw-toolbox.js
//# sourceMappingURL=./build/sw-toolbox.map.json
But It's not big problem to me. I can be solved by remove build.
//# sourceMappingURL=./sw-toolbox.map.json

But my big problem is "I could not take a break point" although its source tree appears on dev tools.

image

I've tried to make break point on Router.prototype.matchMethod function (router.js) but the break point is made on fastest.js(53). Some breakpoints are made well. but most of all are not made on proper code.

So I tried another way of making source map by modifying gulpfile.

I referenced this
https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-uglify-sourcemap.md

 var bundler = browserify({
    entries: ['./lib/sw-toolbox.js'],
    standalone: 'toolbox',
    debug: true
  });
  var bundle = function() {
    return bundler
      .bundle()
      .pipe(source('sw-toolbox.js'))
      .pipe(buffer())
      .pipe(sourcemaps.init({loadMaps: true}))
      .pipe(uglify())
        // Add transformation tasks to the pipeline here.
      .pipe(sourcemaps.write('./'))
      .pipe(gulp.dest('./build/'));
  };
  return bundle();

It works very well.

What was my problem? How can I use source-map by not modifying gulf file.
Thank you for your help in advance.

@wibblymat
Copy link
Contributor

Yep, seems like out source map is not working properly. Sorry about that! We'll take a look.

@jongmoon
Copy link
Author

jongmoon commented Aug 9, 2016

@wibblymat Thank you! 👍

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

Successfully merging a pull request may close this issue.

2 participants