0

Autoprefixer を Grunt、Livereload、および node-sass で動作させようとしています。

接頭辞が付いていないようです。

以下は私のGruntfile.jsです:

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    autoprefixer: {
      options: {
        browsers: ['last 8 versions'],
        map: true
      },
      dist: {
        files: {
          'css/styles.css': 'css/styles.css'
        }
      }
    },

    // Sass to CSS
    sass: {
      app: {
        files: [{
          expand: true,
          cwd: 'scss',
          src: ['*.scss'],
          dest: 'css',
          ext: '.css'
        }]
      },
      options: {
        sourceMap: true,
        outputStyle: 'nested',
        imagePath: "../",
      }
    },

    watch: {
      sass: {
        files: ['scss/{,*/}*.{scss,sass}'],
        tasks: ['sass']
      },
        html: {
        files: ['*.html']
      },
      options: {
        livereload: true,
        spawn: false
      },
      styles: {
        files: ['css/styles.css'],
        tasks: ['autoprefixer']
      }
    },
  });

  // Loads Grunt Tasks
  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-autoprefixer');
  grunt.loadNpmTasks('grunt-contrib-watch');

  // Default task(s).
  grunt.registerTask('default', ['autoprefixer','sass', 'watch']);
};

ファイルにプレフィックスが付けられていることを示す grunt コマンドの出力が表示されますが、css/styles.css を開くと、プレフィックスが表示されません。

$ grunt
Running "autoprefixer:dist" (autoprefixer) task
>> 1 autoprefixed stylesheet created.

何か案は?

4

1 に答える 1