mcasimir / gulp-rollup

gulp plugin for Rollup ES6 module bundler
MIT License
93 stars 12 forks source link

Error Handling Broken? #30

Open remexre opened 8 years ago

remexre commented 8 years ago
gulp.task("js:editor", () =>
    gulp.src("src/editor/editor.js", {read: false})
    // .pipe(plumber())
    // .pipe(xo())
    .pipe(rollup({
        format:    "I think error handling is broken...",
        // plugins:   rollupPlugins,
        sourceMap: true,
    }))
    // .pipe(uglify())
    .pipe(sourcemaps.write())
        .pipe(gulp.dest("dist/")));
sh-4.3$ gulp js:editor
(node:24325) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[20:49:09] Using gulpfile ~/Desktop/project-domino-client/gulpfile.js
[20:49:09] Starting 'js:editor'...
sh-4.3$
remexre commented 8 years ago

Okay, it works if I replace the format with something valid (in my case, umd and then adding a moduleId), uncomment everything, and comment out all export statements from src/editor/editor.js. So... exporting might be broken instead?

remexre commented 8 years ago

If I do the following, it reports the error that I need to use moduleName instead of moduleId:

diff --git a/index.js b/index.js
index b0f5f46..91a13a6 100644
--- a/index.js
+++ b/index.js
@@ -49,7 +49,7 @@ module.exports = function(options) {
             file.sourceMap = map;
           }
           callback(null, file);
-        }, function(err) {
+        }).catch(function(err) {
           setImmediate(function() {
             callback(new PluginError(PLUGIN_NAME, err));
           });