• <legend id='9UYrK'><style id='9UYrK'><dir id='9UYrK'><q id='9UYrK'></q></dir></style></legend>
      <bdo id='9UYrK'></bdo><ul id='9UYrK'></ul>

      1. <tfoot id='9UYrK'></tfoot>
        <i id='9UYrK'><tr id='9UYrK'><dt id='9UYrK'><q id='9UYrK'><span id='9UYrK'><b id='9UYrK'><form id='9UYrK'><ins id='9UYrK'></ins><ul id='9UYrK'></ul><sub id='9UYrK'></sub></form><legend id='9UYrK'></legend><bdo id='9UYrK'><pre id='9UYrK'><center id='9UYrK'></center></pre></bdo></b><th id='9UYrK'></th></span></q></dt></tr></i><div id='9UYrK'><tfoot id='9UYrK'></tfoot><dl id='9UYrK'><fieldset id='9UYrK'></fieldset></dl></div>

        <small id='9UYrK'></small><noframes id='9UYrK'>

      2. gulp 与 gulp-ruby-sass:错误:../style.css.map:3:1:未知单词

        时间:2023-05-29
          <bdo id='Kh3Po'></bdo><ul id='Kh3Po'></ul>

                  <tbody id='Kh3Po'></tbody>
                <tfoot id='Kh3Po'></tfoot>

                  <small id='Kh3Po'></small><noframes id='Kh3Po'>

                  <legend id='Kh3Po'><style id='Kh3Po'><dir id='Kh3Po'><q id='Kh3Po'></q></dir></style></legend>
                  <i id='Kh3Po'><tr id='Kh3Po'><dt id='Kh3Po'><q id='Kh3Po'><span id='Kh3Po'><b id='Kh3Po'><form id='Kh3Po'><ins id='Kh3Po'></ins><ul id='Kh3Po'></ul><sub id='Kh3Po'></sub></form><legend id='Kh3Po'></legend><bdo id='Kh3Po'><pre id='Kh3Po'><center id='Kh3Po'></center></pre></bdo></b><th id='Kh3Po'></th></span></q></dt></tr></i><div id='Kh3Po'><tfoot id='Kh3Po'></tfoot><dl id='Kh3Po'><fieldset id='Kh3Po'></fieldset></dl></div>
                • 本文介绍了gulp 与 gulp-ruby-sass:错误:../style.css.map:3:1:未知单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  使用基本的 gulp/express build watch 时遇到一个奇怪的错误.

                  Getting a strange error using a basic gulp/express build watch.

                  目录布局

                   project/
                     - sass/
                        - style.scss
                     - gulpfile.js
                     - index.html
                  

                  Gulpfile.js

                  var gulp         = require('gulp'),
                      sass         = require('gulp-ruby-sass'),
                      autoprefixer = require('gulp-autoprefixer'),
                      minifycss    = require('gulp-minify-css'),
                      rename       = require('gulp-rename');
                  
                  gulp.task('express', function() {
                    var express = require('express');
                    var app = express();
                    app.use(require('connect-livereload')({port: 4002}));
                    app.use(express.static(__dirname));
                    app.listen(4000);
                  });
                  
                  var tinylr;
                  gulp.task('livereload', function() {
                    tinylr = require('tiny-lr')();
                    tinylr.listen(4002);
                  });
                  
                  function notifyLiveReload(event) {
                    var fileName = require('path').relative(__dirname, event.path);
                  
                    tinylr.changed({
                      body: {
                        files: [fileName]
                      }
                    });
                  }
                  
                  gulp.task('styles', function() {
                      return gulp.src('sass/*.scss')
                        .pipe(sass({ style: 'expanded', sourcemap: false }))
                        .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
                        .pipe(gulp.dest('css'))
                        .pipe(rename({suffix: '.min'}))
                        .pipe(minifycss())
                        .pipe(gulp.dest('css'));
                  });
                  
                  gulp.task('watch', function() {
                    gulp.watch('sass/*.scss', ['styles']);
                    gulp.watch('*.html', notifyLiveReload);
                    gulp.watch('css/*.css', notifyLiveReload);
                  });
                  
                  gulp.task('default', ['styles', 'express', 'livereload', 'watch'], function() {
                  
                  });
                  

                  Style.scss

                  body { position: relative; }
                  

                  快速服务器/livereload 工作正常,但是当它尝试编译样式表时出现此错误(即使使用 sourcemap: false)

                  The express server/livereload works fine, but when it tries to compile the stylesheet I'm getting this error (even with sourcemap: false)

                  gulp-ruby-sass: write style.css.map
                  
                  events.js:72
                          throw er; // Unhandled 'error' event
                                ^
                  Error: <LOCAL_PATH_HERE>/style.css.map:3:1: Unknown word
                  

                  推荐答案

                  现在禁用源映射是个谜.你必须这样做

                  Disabling sourcemaps is some kind of mystery right now. You have to do it like this

                  .pipe(sass({ "sourcemap=none": true }))
                  

                  来源

                  这篇关于gulp 与 gulp-ruby-sass:错误:../style.css.map:3:1:未知单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Gulp less 未正确处理包含未定义的包含变量 下一篇:大型 Web 项目中 Browserify 的最佳实践 - Gulp

                  相关文章

                  最新文章

                    <bdo id='qgkdZ'></bdo><ul id='qgkdZ'></ul>

                    <tfoot id='qgkdZ'></tfoot>
                    <i id='qgkdZ'><tr id='qgkdZ'><dt id='qgkdZ'><q id='qgkdZ'><span id='qgkdZ'><b id='qgkdZ'><form id='qgkdZ'><ins id='qgkdZ'></ins><ul id='qgkdZ'></ul><sub id='qgkdZ'></sub></form><legend id='qgkdZ'></legend><bdo id='qgkdZ'><pre id='qgkdZ'><center id='qgkdZ'></center></pre></bdo></b><th id='qgkdZ'></th></span></q></dt></tr></i><div id='qgkdZ'><tfoot id='qgkdZ'></tfoot><dl id='qgkdZ'><fieldset id='qgkdZ'></fieldset></dl></div>

                    <small id='qgkdZ'></small><noframes id='qgkdZ'>

                    1. <legend id='qgkdZ'><style id='qgkdZ'><dir id='qgkdZ'><q id='qgkdZ'></q></dir></style></legend>