Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

addPushManifest killing gulp process #1271

Closed stramel closed 2 years ago

stramel commented 7 years ago

Description

When using polymer-build#^1.0.0 with gulp in the app from generator-polymer-init-custom-build the gulp process dies on the polymerProject.addPushManifest() line. commenting this line out causes the build to work.

Versions & Environment

Steps to Reproduce

  1. git clone https://github.com/stramel/demo-polymer-build-repro.git
  2. npm i;bower i
  3. npm run build
  4. Observe gulp process fails
  5. Comment out line# 155 in gulpfile.js ( buildStream = buildStream.pipe(polymerProject.addPushManifest());)
  6. npm run build
  7. Observer gulp process runs successfully

Expected Results

Successful build process with push manifest

Actual Results

Unsuccessful build process with push manifest

FredKSchott commented 7 years ago

Thanks for finding this, will try to take a look today.

stramel commented 7 years ago

Ah, @FredKSchott It seems that this error is based on the placement of it.

This fails:

        // Okay, time to pipe to the build directory
        buildStream = buildStream.pipe(gulp.dest(buildDirectory));

        // Now let's generate the HTTP/2 Push Manifest
        buildStream = buildStream.pipe(polymerProject.addPushManifest());

This succeeds:

        // Now let's generate the HTTP/2 Push Manifest
        buildStream = buildStream.pipe(polymerProject.addPushManifest());

        // Okay, time to pipe to the build directory
        buildStream = buildStream.pipe(gulp.dest(buildDirectory));

Besides the obvious derp moment, I would still expect this to still not error out.

FredKSchott commented 7 years ago

Haha nice!

gulp.dest probably doesn't return files (unless you provide a passthrough option) so there's not much we can do here.

stramel commented 7 years ago

@FredKSchott Typically, you can do something like this:

gulp.src('src/**/*.js')
    // This will output the non-minified version
    .pipe(gulp.dest(DEST))
    // This will minify and rename to *.min.js
    .pipe(uglify())
    .pipe(rename({ extname: '.min.js' }))
    .pipe(gulp.dest(DEST));

Here is the "recipe" from gulp https://github.com/gulpjs/gulp/blob/4.0/docs/recipes/minified-and-non-minified.md

FredKSchott commented 7 years ago

huh interesting, I must have had that backwards.

No idea why it wouldn't be working then.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!