oligot / rollup-plugin-nodent

Rollup plugin for ES2017 async/await keywords
27 stars 2 forks source link

question: any limitation on sourcemaps handling? #5

Closed xenogenesi closed 7 years ago

xenogenesi commented 7 years ago

I'm using this plugin with gulp-better-rollup, rollup-plugin-vue and rollup-plugin-buble, when I enable it the result is one single concatenated .js as output with comments removed, and a .map file associated to this altered .js file.

When disabled I get (as expected) one .js and one .map but correctly mapping to a directory tree with the source files untouched, as shown in the chorme developer tools Sources tab (see images link below).

gulp.task('js-main', function(cb) {
    pump([
        gulp.src('src/js/main.js'),
        ifElse(isProd, () => sourcemaps.init()),
        rollup({
            plugins: [
                vue({
                    compileTemplate: true,
                    htmlMinifier: {
                        collapseWhitespace: false,
                        removeComments: false
                    },
                    css: destDir+'/css/bundle.css'}),
                buble(),
                nodent(/*{ sourcemap: true }*/),
            ]}, { format: 'iife' }),
        concat((isProd) ? 'main.min.js' : 'main.js'),
        ifElse(isProd, () => uglify()),
        ifElse(isProd, () => sourcemaps.write('')),
        gulp.dest(destDir+'/js'),
        browserSync.stream()
    ], cb);
});

right wrong

Any idea why or how to solve?

oligot commented 7 years ago

Hi,

Can you create a small project that reproduces the bug so that I can try to understand what's the problem ?

xenogenesi commented 7 years ago

Hi, thanks for replying and for the plugin, there

oligot commented 7 years ago

I just created a PR on your project that fixes the issue. The trick is to set the option sourceMap to true (instead of sourcemaps).

Can you tell me if it works for you ?

xenogenesi commented 7 years ago

Dammit, yes it works, sorry about, thank you very much

oligot commented 7 years ago

No problem, glad it works for you.