Проблема
index.html
не загружается мой .css
файл. У меня настроен файл gulp.js
, и я чувствую, что каталог папок может быть здесь блокирующим. Мои .scss
файлы в папке /src/scss
правильно компилируются в css в моей папке /build/css
.
Желаемый результат
Для индекса. html чтобы загрузить мои css файлы и быть видимыми с помощью редактора стиля Firefox.
Каталог папок

Basi c HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link type="text/css" href="../build/css/styles.css" />
<title>Boiler plate</title>
</head>
<body>
<h1>Project name goes here</h1>
<script src="./scripts/index.js"></script>
</body>
</html>
Gulp. js file
// const gulp = require('gulp');
const { series, src, dest, watch } = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();
//Compile SCSS into CSS
function style() {
// 1. Find SCSS file
return (
src('./src/scss/**/*.scss')
// 2. Pass through sass compiler
.pipe(sass())
.on('error', sass.logError)
// 3. Where do save compiled css
.pipe(dest('./build/css'))
// 4. Stream changes to all browsers
.pipe(browserSync.stream())
);
}
// Watch for changes in src directory and make updates
function watchFiles() {
browserSync.init({
server: {
baseDir: './src'
}
});
watch('./src/scss/**/*.scss', style);
watch('./src/*.html').on('change', browserSync.reload);
watch('./src/scripts/**/*.js').on('change', browserSync.reload);
}
exports.style = style;
exports.watchFiles = watchFiles;
exports.default = series(style, watchFiles);
Текущие ошибки
Firefox Консоль показывает следующую ошибку
The resource from “http://localhost:3000/build/css/styles.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)
Когда я удаляю rel="stylehseet"
и заменяю на type="text/css"
, ошибка исчезает. Однако, та же проблема сохраняется ... Файл CSS не загружен.