Giter Club home page Giter Club logo

gulp-rev-orig's Issues

Relative path recognition not working

Hi,
There is a problem with recognition if a file is referenced by relative path. Everything works correct for the first file, but if there are multiple files with relative paths in a row, every second file path is treated as absolute path.
Example:

gulp.task('revOrig-withBase', function(argument) {
    gulp.src('test.html')
        .pipe(revOrig({
            base: 'assets/'
        }))
        .pipe(gulp.dest('./dist'));
});

for html file with 2 relative reference paths:

<script src="/../assets/index.js"></script>
<script src="/../assets/index.js"></script>

results an single file not found message, and invalid output:

    <script src="/../assets/index.js?v=3fffb693"></script>
    <script src="/../assets/index.js"></script>

The above can be fixed by removing "g" option from regular expression options in line 13.
var regOption = 'i';

Best regards,

Multiple CDN script includes will fail the build with 'not found' error

If you import more than 1 script from a CDN, rev will fail on the 2nd one.

Sample html:

<script src="main.js"></script>
<script src="https://apis.google.com/js/platform.js"></script>
<script src="https://apis.google.com/js/platform2.js"></script>

Running rev against it will get a '/home/platform2.js not found error'. This seems to be triggered by the fact that there are multiple imports in a row. If I add a script import for a local file between those 2 lines, then the file will process fine:

<script src="main.js"></script>
<script src="https://apis.google.com/js/platform.js"></script>
<script src="main.js"></script>
<script src="https://apis.google.com/js/platform2.js"></script>

as will this (note multiple local files in this example):

<script src="main.js"></script>
<script src="main.js"></script>
<script src="https://apis.google.com/js/platform2.js"></script>

My task is barebones:

gulp.task('client.postprocess_html:dist', () => {
  return gulp.src('./client/dist/*.html')
    .pipe(rev())
    .pipe(gulp.dest('./client/dist/'));
});

I got a problem

我在vs项目上使用的时候,在添加版本号上之后,页面会出现乱码的情况,最后发现当出现乱码时,编码格式是utf-8(无签名);而没有乱码时,格式是utf-8(有签名)。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.