문제 설명
Grunt 및 Compass와 함께 node‑normalize‑scss 사용 (Using node‑normalize‑scss with Grunt and Compass)
Compass를 사용하여 SCSS를 컴파일하기 위해 현재 Grunt로 설정된 프로젝트에서 normalize.scss를 사용하고 싶습니다.
나는 이것을 찾았고 아래 명령을 사용하여 설치했습니다(여기에서: https://www.npmjs.com/package/node‑normalize‑scss)
npm install node‑normalize‑scss ‑‑save‑ dev
그 아래에는 꿀꺽꿀꺽 꿀꺽 꿀꺽 꿀꺽 꿀꺽꿀꺽거리는 구성 예제가 있지만 나침반에 대한 구성 예제는 없습니다. 다음을 사용해 보았습니다.
includePaths: require('node‑normalize‑scss').includePaths
node_modules/node‑normalize‑scss/',
하지만 이것을 사용하면
>> 파일 " 스타일/sass/style.scss"가 변경되었습니다. 로컬 Npm 모듈 "node‑normalize‑scss"를 찾을 수 없습니다. 설치되었나요?
하지만 normalize.scss를 css로 컴파일하는 것 같으니 일종의 작동이 되는 것 같아요.
있나요? 컴파일 시 오류가 발생하지 않도록 하는 더 나은 솔루션이 있습니까?
감사합니다.
변경되었습니다. 로컬 Npm 모듈 "node‑normalize‑scss"를 찾을 수 없습니다. 설치되었나요?하지만 normalize.scss를 css로 컴파일하는 것 같으니 일종의 작동이 되는 것 같아요.
있나요? 컴파일 시 오류가 발생하지 않도록 하는 더 나은 솔루션이 있습니까?
감사합니다.
변경되었습니다. 로컬 Npm 모듈 "node‑normalize‑scss"를 찾을 수 없습니다. 설치되었나요?하지만 normalize.scss를 css로 컴파일하는 것 같으니 일종의 작동이 되는 것 같아요.
있나요? 컴파일 시 오류가 발생하지 않도록 하는 더 나은 솔루션이 있습니까?
감사합니다.
참조 솔루션
방법 1:
I, too, had this problem, and eventually found the answer on here: https://github.com/gruntjs/grunt‑contrib‑compass
The option to use for compass (which takes completely different options to sass) is importPath, which you've found, and it works the same way.
So, importPath: require('node‑normalize‑scss').includePaths
should, hopefully, work for you.
This is my current Gruntfile.js in full:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
dist: {
options: {
importPath: require('node‑normalize‑scss').includePaths,
sassDir: 'path/to/sass',
cssDir: 'path/to/css'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['compass']
}
}
});
grunt.loadNpmTasks('grunt‑contrib‑compass');
grunt.loadNpmTasks('grunt‑contrib‑watch');
grunt.registerTask('default',['watch']);
}