Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to work with [email protected] #69

Open
tryer3000 opened this issue Nov 16, 2016 · 2 comments
Open

fail to work with [email protected] #69

tryer3000 opened this issue Nov 16, 2016 · 2 comments

Comments

@tryer3000
Copy link

rev-replace will replace original

<script> x.js</script>

with

<script>x.somehash.map</script>

Here is my gulp task:

    .pipe(useref())
    .pipe(jsFilter)
    .pipe(sourcemaps.init())
    .pipe(ngAnnotate())
    .pipe(uglify({preserveComments: uglifySaveLicense})).on('error', conf.errorHandler('Uglify'))
    .pipe(rev())
    .pipe(sourcemaps.write('maps'))
    .pipe(jsFilter.restore)
    .pipe(revReplace())
@akatakritos
Copy link

Oh I'm so glad I'm not the only one.

I worked around this with a filter that filtered out map files:

  const removeMapFiles = filter(['**/*', '!maps/**')], {restore: true});

// gulp stuff here...

    .pipe(removeMapFiles) // remove map files from the stream because we don't want them written to the markup
    .pipe(revReplace())
    .pipe(removeMapFiles.restore)

Here's a tiny reproducible project: https://github.com/akatakritos/gulp-rev-replace-repro

I'll look into a fix this afternoon as well.

@jonlil
Copy link

jonlil commented Jan 11, 2017

@akatakritos - thanks, that solved my issue. But you have some small issues in example

  const removeMapFiles = filter(['**/*', '!maps/**'], {restore: true});

// gulp stuff here...

    .pipe(removeMapFiles) // remove map files from the stream because we don't want them written to the markup
    .pipe(revReplace())
    .pipe(removeMapFiles.restore())
``

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

No branches or pull requests

3 participants