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

static files url adjuster #58

Closed
julianpaulozzi opened this issue Jun 17, 2015 · 1 comment
Closed

static files url adjuster #58

julianpaulozzi opened this issue Jun 17, 2015 · 1 comment

Comments

@julianpaulozzi
Copy link

Is there any way to change the css absolutes urls refs on transform?
Additionally there is how to specify the output directory to static files (images, fonts, css, js) separately?

@chmontgomery
Copy link
Contributor

Yes.

Firstly, you can modify the path prefixes inside bundle.result.json as part of the call to bundle.results as seen here: examples/custom-transforms/gulpfile.js

Second, you can put each bundle under a custom folder structure by naming your bundle appropriately. Hopefully this example makes it clear: examples/custom-url-paths/bundle.config.js

As far as copying other static files (fonts, images, etc), everything that is possible is shown in this example: examples/copy

All of the above assumes you're outputting all your static files into a single output folder, e.g. /public. If for some reason you want to output files to different top level folders, you'd need to create different gulp tasks using different bundle configs, e.g.:

// gulpfile.js

var gulp = require('gulp'),
  gbundle = require('gulp-bundle-assets');

gulp.task('bundle-js-css', function () {
  return gulp.src('./bundle-js-css.config.js')
    .pipe(gbundle())
    .pipe(gulp.dest('./compiled-assets')); // js, css output folder
});

gulp.task('bundle-font-images', function () {
  return gulp.src('./bundle-font-images.config.js')
    .pipe(gbundle())
    .pipe(gulp.dest('./static-assets')); // images, fonts, etc output folder
});

If these examples don't clear things up please reply back.

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

2 participants