Grunt 및 Compass와 함께 node-normalize-scss 사용 (Using node-normalize-scss with Grunt and Compass)


문제 설명

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']);
}

(by asdmcjim)

참조 문서

  1. Using node‑normalize‑scss with Grunt and Compass (CC BY‑SA 2.5/3.0/4.0)

#gruntjs #SASS #compass






관련 질문

프로그램에서 연속적으로 오류 코드를 받는 Gruntfile (Gruntfile getting error codes from programs serially)

grunt.initConfig() 전에 비동기 작업을 수행하려면 어떻게 해야 합니까? (How can I perform an asynchronous operation before grunt.initConfig()?)

grunt 및 qunit을 사용한 로깅 (Logging with grunt and qunit)

Intellij IDEA 13 - 최신 JS 파일을 사용한 아티팩트 빌드 프로세스(grunt 빌드를 통해) (Intellij IDEA 13 - Artifact build process with latest JS files (Via grunt build))

IntelliJ IDEA에서 Grunt 작업에 대한 사용자 지정 config.json 위치 설정 (Setup custom config.json location for Grunt tasks in IntelliJ IDEA)

Grunt 및 Compass와 함께 node-normalize-scss 사용 (Using node-normalize-scss with Grunt and Compass)

npm grunt-libsass 설치 오류 (Error installing npm grunt-libsass)

루트 폴더에 없는 Gruntfile.js가 있는 Visual Studio 작업 실행기 탐색기 (Visual Studio Task Runner Explorer with Gruntfile.js that is not in the root folder)

하위 디렉토리의 Angular2.0, SystemJS는 각도 구성 요소를 가져올 수 없습니다. (Angular2.0 in subdirectory, SystemJS cant import angular components)

html5 모드를 사용하여 Angular 다시 로드 (Reload Angular using html5 mode)

그런트 작업 옵션을 이해하는 방법 (How to understand Grunt task options)

오류: 프로젝트의 기본 XML 네임스페이스는 MSBuild XML 네임스페이스여야 합니다. (Error: The default XML namespace of the project must be the MSBuild XML namespace)







코멘트