0
순수 nodejs와 grunt를 사용하여 boostrap-sass를 컴파일하려고합니다. 그래서, 루비 나 레일이나 보석에 루비가 없습니다.grunt-sass가 bootstrap-sass를 컴파일하지 않습니다.
내 package.json :
{
"name": "myProject",
"version": "1.0.0",
"dependencies": {
"grunt": "^1.0.1",
"grunt-bootlint": "^0.10.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-compress": "^1.3.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-cssmin": "^1.0.2",
"grunt-contrib-uglify": "^2.0.0",
"grunt-sass-lint": "^0.2.0",
"grunt-contrib-jshint": "^1.0.0"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"grunt-sass": "^1.2.1",
"node-sass": "^3.10.1",
"typescript": "^2.0.6",
"typings": "^1.5.0"
}
}
내 Gruntfile.js :
module.exports = function (grunt)
{
grunt.loadNpmTasks("grunt-sass");
grunt.loadNpmTasks("grunt-sass-lint");
grunt.loadNpmTasks("grunt-bootlint");
grunt.loadNpmTasks("grunt-contrib-jshint");
var relaxerrors = [
"App/Mvc/views/notallowed.phtml",
"App/Mvc/views/ajax/*.phtml",
"App/Mvc/views/backend/*.phtml"
];
grunt.initConfig({
sass: {
options: {
includePaths: ["node_modules/bootstrap-sass/assets/stylesheets/bootstrap"],
precision: 10,
sourcemap: "inline",
trace: true,
unixNewlines: true
},
dist: {
files: {
"web/assets/styles/frontend.min.css": "assets/styles/index.scss",
"web/assets/styles/backend.min.css": "assets/styles/dashboard.scss",
"web/assets/styles/bootstrap.min.css": "node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss"
}
}
},
sasslint: {
target: [ "assets/styles/*.scss" ]
},
jshint: {
files: [ "assets/js/*.js" ],
options: {
globals: {
jquery: true
}
}
},
bootlint: {
options: {
stoponerror: true,
showallerrors: true,
stoponwarning: false,
relaxerror: {
"E001": relaxerrors,
"W001": relaxerrors,
"W002": relaxerrors,
"W003": relaxerrors,
"W005": relaxerrors
}
},
files: [ "App/Mvc/views/*.phtml", "App/Mvc/views/*.html" ]
}
}
);
grunt.registerTask("validate:styles", [ "sasslint" ]);
grunt.registerTask("validate:js", [ "jshint" ]);
grunt.registerTask("validate:bootstrap", [ "bootlint" ]);
grunt.registerTask("validate:all", [ "validate:bootstrap", "validate:styles", "validate:js" ]);
grunt.registerTask("build:styles", [ "validate:styles", "sass" ]);
};
내가 그것을 호출 오전 : 나에게 다음과 같은 출력을 보여줍니다
grunt build:styles --force --verbose
:
Running "sass" task
Running "sass:dist" (sass) task
Verifying property sass.dist exists in config...OK
Files: assets/styles/index.scss -> web/assets/styles/frontend.min.css
Files: assets/styles/dashboard.scss -> web/assets/styles/backend.min.css
Files: node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss -> web/assets/styles/bootstrap.min.css
Options: precision=10, includePaths=["node_modules/bootstrap-sass/assets/stylesheets/bootstrap"], sourcemap="inline", trace, unixNewlines
Options: precision=10, includePaths=["node_modules/bootstrap-sass/assets/stylesheets/bootstrap"], sourcemap="inline", trace, unixNewlines
Options: precision=10, includePaths=["node_modules/bootstrap-sass/assets/stylesheets/bootstrap"], sourcemap="inline", trace, unixNewlines
Writing web/assets/styles/backend.min.css...OK
Writing web/assets/styles/frontend.min.css...OK
Done.
우리가 볼 수 있듯이, 부트 스트랩에 관해서는 작동을 멈추게됩니다. 어떤 도움이라도 좋을 것입니다.
오, 고마워, 내 잘못. 간단히 내 문제를 해결했습니다. 컴파일러에게 무시한 것을 사용하라고했습니다. – alpham8