Git Product home page Git Product logo

gulp-dom-src's People

Contributors

cgross avatar psalaets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gulp-dom-src's Issues

Missing positive glob

I'm getting the following error:

[12:57:02] Error: Missing positive glob

Guess there was some BC on gulp or a dependency causing this? Thank you.

Not generating minified file from source?

Here's my task:

gulp.task('js', function() {
return domsrc({file:'source/wp-content/themes/'+project.theme+'/footer.php',selector:'script',attribute:'src'})
.pipe(concat('app.min.js'))
.pipe(uglify())
.pipe(gulp.dest('runtime/wp-content/themes/'+project.theme+'/'));
});

project.theme = 'leviathan' and resolves to a real path

The second half from your example works (removing the scripts and injecting the reference to the minified script) but the minified script is never created in the /runtime/ directory.

This is the JS in my footer.php:

<script src="/wp-content/themes/leviathan/assets/js/libraries/jquery-1.10.1.min.js"></script>
<script src="/wp-content/themes/leviathan/assets/js/libraries/gumby/ui/gumby.checkbox.js"></script>

Writeable stream interface

Is there any way for gulp-dom-src to be writeable? I am generating html which I want to pipe into gulp-dom-src to scan for script tags.

Right now I am doing

gulp.task('processScripts', function(cb) {
  var generateHtml = gulp.src(pathToTemplates)
    .pipe(evalTemplates())
    .pipe(gulp.dest(destDir));

  generateHtml.on('end', function() {
    var processScripts = gulpDomSrc({
      file: destDir + 'index.html',
      selector: 'script'
      attribute: 'src'
    })
    .pipe(processJsFiles())
    .pipe(gulp.dest(...);

    processScripts.on('end', cb);
  });
});

I use events to order things properly and write/read disk an extra time.

I wish I could do

gulp.task('processScripts', function() {
  return gulp.src(pathToTemplates)
    .pipe(evalTemplates())
    .pipe(gulpDomSrc.writeable({ // <-- this would be new
      selector: 'script'
      attribute: 'src'
    })
    .pipe(processJsFiles())
    .pipe(gulp.dest(...);
});

Would you be open to a PR that implemented something like the latter example?

Vinyl-fs throws Error: Received a non-Vinyl object in `dest()`

With newest update of Vinyl-fs, gulp-dom-src isn't returning a properly formatted vinyl type that vinyl-fs can consume.

domSrc({
file: files.app.indexHtml,
selector: 'script',
attribute: 'src'
})
.pipe(...)
.pipe(gulp.dest(...));

Error: Received a non-Vinyl object in dest()

$ gulp -v
[12:06:08] CLI version 2.0.0
[12:06:08] Local version 4.0.0
Gulp ^4.0.0 using Vinyl-FS^3.0.0

queryParams problem

if my filepath includes a queryParam how can I ignore the queryParams?
Eg. when I want to fetch the file it should be the file styles/main.less

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.