Я запускаю файл grunt ниже, чтобы преобразовать app / sass / _base.scss в test.css.Когда я запускаю скрипт с «grunt», он видит файл _base.scss и отвечает следующим образом:
Запуск задачи «sass: dist» (sass)
Готово.
Время выполнения (2019-03-03 20:23:17 UTC-5) загрузка задач 2 мс ▇▇▇▇▇▇▇▇ 17% sass: dist 9 мс ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 75% Всего 12 мс
, но файл test.css никогда не выводится или по крайней мереЯ не могу найти это ..
gruntfile.js
module.exports = function (grunt) {
var appConfig = grunt.file.readJSON('package.json');
// Load grunt tasks automatically
// see: https://github.com/sindresorhus/load-grunt-tasks
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
// see: https://npmjs.org/package/time-grunt
require('time-grunt')(grunt);
var pathsConfig = function (appName) {
this.app = appName || appConfig.name;
return {
app: this.app,
templates: '/templates',
css: this.app + '/static/css',
sass: this.app + '/static/sass',
fonts: this.app + '/static/fonts',
images: this.app + '/static/img',
js: this.app + '/static/js',
manageScript: 'local.py',
}
};
grunt.initConfig({
paths: pathsConfig(),
pkg: appConfig,
// see: https://github.com/sindresorhus/grunt-sass
sass: {
dev: {
options: {
outputStyle: 'nested',
sourceMap: false,
precision: 10
},
files: {
'test.css': '<%= paths.sass %>/_base.scss'
},
},
dist: {
options: {
outputStyle: 'compressed',
sourceMap: false,
precision: 10
},
files: {
'<%= paths.css %>/test.css': '<%= paths.sass %>/_base.scss'
},
}
},
});
grunt.registerTask('build', [
'sass:dist'
//'postcss'
]);
grunt.registerTask('default', [
'build'
]);
};