首页 > 解决方案 > 使用 git 设置开发环境但不加载引导程序和字体真棒

问题描述

所以我试图设置我的开发环境,因为我正在关注教程中的人,他使用的是旧版本的 gulp,它适用于旧版本的 Node.js,但新版本不能......我目前正在运行gulp v4 和 node 是最新版本,它只是不想合作......使用 git 我想安装 bootstrap 和 fontawesome 因为我已经安装了 SASS 并且它正在工作,但我还没有找到用于引导和gulpfile.js 中的 fontawesome ......这是我的代码现在的样子,SASS 正在工作并且站点会自行更新,但我不知道如何导出引导程序和 fontawesome,因为在 gulp 4 中一切都发生了变化......

const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();

//compile scss into css
function style() {
    return gulp.src('src/scss/**/*.scss')
        .pipe(sass().on('error', sass.logError))
        .pipe(gulp.dest('src/css'))
        .pipe(browserSync.stream());
}

function watch() {
    browserSync.init({
        server: {
            baseDir: "./src",
            index: "/index.html"
        }
    });
    gulp.watch('src/scss/**/*.scss', style)
    gulp.watch('./*.html').on('change', browserSync.reload);
    gulp.watch('./js/**/*.js').on('change', browserSync.reload);
}

exports.style = style;
exports.watch = watch;

标签: gitsassgulp

解决方案


推荐阅读