futurechan / gulp-asset-transform

13 stars 3 forks source link

Output paths are cut short #18

Open ashleydavis opened 9 years ago

ashleydavis commented 9 years ago

Thanks for this plugin, it's definitely a bit improvement over gulp-usemin.

I've had a problem with the following:

return gulp.src('src/html/**/*.html') // Multiple html files.
            .pipe(using())
    .pipe(at({
        css: {
            tasks: [ less(), 'concat' ]
        }
        }))
       .pipe(using())
       .pipe(gulp.dest('dest'));

This matches multiple html files in various sub-directories. After passing through 'at' the paths to the html files are flattened, the sub-directories are removed destroying the directory structure.

This is demonstrated by both 'using()' lines that show the before and after paths.

futurechan commented 9 years ago

Thanks for the compliment. I'm thinking it's because of the **/*. There is probably a presumtion that the assets are relative to your .htm file. Can you include the .html comment directives?

futurechan commented 9 years ago

@ashleydavis Actually if you could provide a reproducible sample, that would be great!

futurechan commented 9 years ago

@ashleydavis particularly i'm interested in how you serve the assets. If you came from gulp-usemin, were you using the alternate paths option for compilation? If so, I have every intention of adding that support right away. Let me know.

ashleydavis commented 9 years ago

Hi, sorry I've been quiet. I've had to change my grunt script to work around this so I'm not sure I can easily give you the broken version. The problem is that your plugin is not able to work on multiple html files in different sub directories. It turns out that I only need it to operate on my single html file anyway so I've worked around it.

Feel free to close this issue, just be aware that if people are trying to use you plugin to process multiple html pages that it doesn't work for that.

If I need to process multiple pages soon (this could happen when I add my login and user-profile pages) I'm going to have to stop using your plugin and find another or roll my own.