gpt4 book ai didi

css - 无法通过 View 从 scss 加载 css 样式

转载 作者:行者123 更新时间:2023-11-28 03:15:26 24 4
gpt4 key购买 nike

我无法加载样式以从 scss 查看,下面是 gulp.js,

//编译并自动为样式表添加前缀

gulp.task('styles', function () {

return gulp.src([
'Content/styles/**/*.scss',
'Content/styles/**/*.css'
])
.pipe($.newer('Content/styles'))
//.pipe($.newer('.tmp/styles'))
.pipe($.sourcemaps.init())
.pipe($.sass({
precision: 10
}).on('error', $.sass.logError))
.pipe($.autoprefixer({ browsers: AUTOPREFIXER_BROWSERS }))
.pipe(gulp.dest('Content/styles'))
//.pipe(gulp.dest('.tmp/styles'))
// Concatenate And Minify Styles
.pipe($.if('*.css', $.cssnano()))
.pipe($.size({ title: 'styles' }))
.pipe($.sourcemaps.write('./'))
.pipe(gulp.dest('Content'));
});

最佳答案

假设 Content 是您的目录,您可以使用相对路径,例如:-

gulp.task('styles', function () {

return gulp.src([
'./Content/styles/**/*.scss',
'./Content/styles/**/*.css'
])
.pipe($.newer('./Content/styles'))
//.pipe($.newer('.tmp/styles'))
.pipe($.sourcemaps.init())
.pipe($.sass({
precision: 10
}).on('error', $.sass.logError))
.pipe($.autoprefixer({ browsers: AUTOPREFIXER_BROWSERS }))
.pipe(gulp.dest('./Content/styles'))
//.pipe(gulp.dest('.tmp/styles'))
// Concatenate And Minify Styles
.pipe($.if('*.css', $.cssnano()))
.pipe($.size({ title: 'styles' }))
.pipe($.sourcemaps.write('./'))
.pipe(gulp.dest('./Content'));
});

关于css - 无法通过 View 从 scss 加载 css 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45499267/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com