前提・実現したいこと
現在、WordPress化のオリジナルサイトを製作中です。
gulpを使用しており、製作中に以下のエラーメッセージが発生しました。
gulpfile.jsに、何かしら原因があるかとは思いますが、どの部分が原因か特定できていません。
ご教授いただけますと幸いです。
よろしくお願いします。
エラー内容
ターミナル
ma@maMacBook-Pro themes % gulp [13:52:17] Using gulpfile ~/Local Sites/wp/app/public/wp-content/themes/gulpfile.js [13:52:17] Starting 'default'... [13:52:17] Starting 'cssSass'... [13:52:17] 'cssSass' errored after 357 ms [13:52:17] Error: @media missing '}' near line 2355:1 at error (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/css-parse/index.js:57:15) at atmedia (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/css-parse/index.js:347:26) at atrule (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/css-parse/index.js:457:10) at rules (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/css-parse/index.js:103:44) at stylesheet (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/css-parse/index.js:73:16) at module.exports (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/css-parse/index.js:485:10) at Transform.transform [as _transform] (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/gulp-merge-media-queries/index.js:133:19) at Transform._read (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/gulp-merge-media-queries/node_modules/readable-stream/lib/_stream_transform.js:184:10) at Transform._write (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/gulp-merge-media-queries/node_modules/readable-stream/lib/_stream_transform.js:172:12) at doWrite (/Users/ma/Local Sites/wp/app/public/wp-content/themes/node_modules/gulp-merge-media-queries/node_modules/readable-stream/lib/_stream_writable.js:237:10) [13:52:17] 'default' errored after 361 ms
glupfile.js
* package */ const { src, dest, watch, series, parallel } = require("gulp"); // const gulp = require("gulp"); const sass = require("gulp-sass"); const plumber = require("gulp-plumber"); const notify = require("gulp-notify"); const sassGlob = require("gulp-sass-glob"); const mmq = require("gulp-merge-media-queries"); const postcss = require("gulp-postcss"); const autoprefixer = require("autoprefixer"); const cssdeclsort = require("css-declaration-sorter"); const cleanCSS = require("gulp-clean-css"); const cssnext = require("postcss-cssnext") const rename = require("gulp-rename"); const sourcemaps = require("gulp-sourcemaps"); const themeName = "WordPressTheme"; // WordPress theme name const srcPath = { css: './sass/**/*.scss', } const destPath = { css: `./${themeName}/assets/css`, } /* compile sass */ // gulp.task("sass", function() { // return gulp const cssSass = () => { return src(srcPath.css) .pipe(sourcemaps.init()) .pipe( plumber({ errorHandler: notify.onError('Error:<%= error.message %>') })) .pipe(sassGlob()) .pipe(sass({ outputStyle: 'expanded' })) //指定できるキー expanded compressed .pipe(postcss([autoprefixer({ // autoprefixer grid: true })])) .pipe(postcss([cssdeclsort({ // sort order: "alphabetical" })])) .pipe(mmq()) // media query mapper .pipe(dest(destPath.css)) .pipe(cleanCSS()) .pipe(rename({ extname: '.min.css' })) .pipe(sourcemaps.write('./map')) .pipe(dest(destPath.css)) .pipe(notify({ message: 'Sassをコンパイルしました!', onLast: true })) } const watchFiles = () => { watch(srcPath.css, series(cssSass)) // watch(srcPath.img, series(imgImagemin)) } exports.default = series(series(cssSass), parallel(watchFiles));
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。