3

我完全按照文档中的说明做了所有事情: https ://github.com/sindresorhus/gulp-ruby-sass/blob/master/readme.md

这是我在 gulpfile.js 中的代码:

// Sass configuration
const gulp = require('gulp');
const sass = require('gulp-ruby-sass');
const sourcemaps = require('gulp-sourcemaps');

gulp.task('sass', () =>
    sass('kraater-web/src/app/css/admin/vars.scss', {sourcemap: true})
        .on('error', sass.logError)
        // for inline sourcemaps
        .pipe(sourcemaps.write())
        // for file sourcemaps
        .pipe(sourcemaps.write('maps', {
            includeContent: false,
            sourceRoot: 'source'
        }))
        .pipe(gulp.dest('kraater-web/src/app/css/'))
);

gulp.task('default', ['sass'], function() {
})

当我运行它时,我只是得到这个输出,并且没有生成文件:

[15:47:25] Using gulpfile C:\wamp\www\site17\gulpfile.js
[15:47:25] Starting 'sass'...
[15:47:25] Could not find an option named "sourcemap".
[15:47:25] Usage: sass <input.scss> [output.css]
       sass <input.scss>:<output.css> <input/>:<output/>

=== Input and Output ===================
    --[no-]stdin               Read the stylesheet from stdin.
    --[no-]indented            Use the indented syntax for input from stdin.
-I, --load-path=<PATH>         A path to use when resolving imports.
                               May be passed multiple times.

-s, --style=<NAME>             Output style.
                               [expanded (default), compressed]

    --update                   Only compile out-of-date stylesheets.

=== Source Maps ========================
    --[no-]source-map          Whether to generate source maps.
                               (defaults to on)

    --source-map-urls          How to link from source maps to source files.
                               [relative (default), absolute]

    --[no-]embed-sources       Embed source file contents in source maps.
    --[no-]embed-source-map    Embed source map contents in CSS.

=== Other ==============================
-i, --interactive              Run an interactive SassScript shell.
-c, --[no-]color               Whether to emit terminal colors.
-q, --[no-]quiet               Don't print warnings.
    --[no-]trace               Print full Dart stack traces for exceptions.
-h, --help                     Print this usage information.
    --version                  Print the version of Dart Sass.
[15:47:25] Finished 'sass' after 416 ms
[15:47:25] Starting 'default'...
[15:47:25] Finished 'default' after 11 μs

Watching build tasks has finished.

想法如何让它工作?

4

0 回答 0