user2915962
user2915962

Reputation: 2711

Use the gulpfiles .tmp-folder

Im trying to get my head around Gulp and i am using. Yeoman´s webapp

Im trying to add some css-files to the project and hopefully get it to end up in the dist/styles-folder.

When adding scss-files to my app/styles-folder and build the project, the files end up in a .tmp-folder. I suppose this is the task that does it:

gulp.task('styles', () => {

  return gulp.src('app/styles/*.scss')
    .pipe($.plumber())
    .pipe($.sourcemaps.init())
    .pipe($.sass.sync({
      outputStyle: 'expanded',
      precision: 10,
      includePaths: ['.']
    }).on('error', $.sass.logError))
    .pipe($.autoprefixer({browsers: ['> 1%', 'last 2 versions', 'Firefox ESR']}))
    .pipe($.sourcemaps.write())
    .pipe(gulp.dest('.tmp/styles'))
    .pipe(reload({stream: true}));
});

The get compiled from scss to css which should be a good thing but how do I get them from the .tmp-folder tom my dist/index?

I tried: <link rel="stylesheet" href="./.tmp/styles/style.css"> It returned a 404 but even so, I cant imagine that this is the right way? Or swill my dist-folder have access to the .tmp-folder? Help appreciated. Thanks

Upvotes: 1

Views: 1502

Answers (1)

Mark Stosberg
Mark Stosberg

Reputation: 13381

It seems you want to set the destination folder to dist, not tmp:

 .pipe(gulp.dest('dist/styles'))

Upvotes: 1

Related Questions