Closed manuel-di-iorio closed 8 years ago
Sorry for bump, is that possible?
Sure. I'm looking into it.
Wait, would transformPath
not work?
Isn't transformPath
applied on the search of the raw assets (so not the compilation) ?
"in case the path needs to be modified before **search** happens."
Ah yes, I see.
There's now a base option to specify the output folder relative to the cwd.
I have an scenario a little different.
dist/
|-public/
|-scripts/
|-server
|-view/
|-file.jade
file.jade
<!-- build:js({client,node_modules}) scripts/client.js -->
.
.
<!-- endbuild -->
and gulp task
gulp.task('build:client', () => {
return gulp.src('dist/server/view/file.jade', {base: 'dist'})
.pipe(useref())
.pipe(gulp.dest('dist'));
});
On run, gulp overwrite my file correctly 😄
<script src="scripts/client.js"></script>
But the file is create in the same path 😢 dist/scripts/client.js
and I can find a way to put on the compile file in the right path dist/public/scripts/client.js
I try to set base, but I'm sure that is not the way. I need some opton that let me prefix the save path that come from "useref".
Some Ideas?
+1 @nathanredblur
+1 @nathanredblur
I fix this, I don't remember well how but I think that was something like this.
gulp.task('build:client', () => {
return gulp.src('dist/server/view/file.jade', {base: 'dist/public'})
.pipe(useref())
.pipe(gulp.dest('dist/public'));
});
If someone can test and confirm, will be nice.
Related to this feature request: https://github.com/jonkemp/gulp-useref/issues/106
I have this folder structure:
But instead useref compiles my assets (js) inside the html folder and I'm looking for an option to specify a different relative path for the assets.
useref html block code:
Useref correctly replaces the path in the compiled html file of the js assets with /app/js/script.js but as written above, doesn't compile in the correct folder the assets (that is not app/html/app/js/script.js but app/js/script.js). The option needed should be like "outputRelativePath" of gulp-usemin
Thanks for attention