首页 > 其他 > 详细

sass coffee 和grunt的各种命令

时间:2016-01-15 15:50:04      阅读:117      评论:0      收藏:0      [点我收藏+]

grunt自动编译:命令 grunt watch

Gruntfile.js:

 1 module.exports = function(grunt) {
 2 
 3     // Project configuration.
 4     grunt.initConfig({
 5 
 6         //Read the package.json (optional)
 7         pkg: grunt.file.readJSON(‘package.json‘),
 8 
 9         // Metadata.
10         meta: {
11             basePath: ‘../‘,
12             srcPath: ‘../assets/sass/‘,
13             deployPath: ‘../assets/css/‘
14         },
15 
16         banner: ‘/*! <%= pkg.name %> - v<%= pkg.version %> - ‘ +
17                 ‘<%= grunt.template.today("yyyy-mm-dd") %>\n‘ +
18                 ‘* Copyright (c) <%= grunt.template.today("yyyy") %> ‘,
19 
20         // Task configuration.
21         sass: {
22             dist: {
23                 files: {
24                     ‘<%= meta.deployPath %>test.css‘: ‘<%= meta.srcPath %>test.scss‘
25                 },
26                 options: {
27                     sourcemap: ‘true‘
28                 }
29             }
30         },
31         watch: {
32             scripts: {
33                 files: [
34                     ‘<%= meta.srcPath %>/**/*.scss‘
35                 ],
36                 tasks: [‘sass‘]
37             }
38         }
39     });
40 
41     // These plugins provide necessary tasks.
42     grunt.loadNpmTasks(‘grunt-contrib-sass‘);
43     grunt.loadNpmTasks(‘grunt-contrib-watch‘);
44 
45     // Default task.
46     grunt.registerTask(‘default‘, [‘sass‘]);
47 };

package.json:

1 {
2   "name": "gruntSass",
3     "version": "0.0.1",
4     "devDependencies": {
5         "grunt": "0.4.1",
6         "grunt-contrib-watch": "0.4.3",
7         "grunt-contrib-sass": "0.4.0"
8     }
9 }

原址:http://www.w3cplus.com/preprocessor/nodejs-and-grunt-compile-sass-to-css.html

 

coffee自动编译:coffee --watch --compile experimental.coffee

原址:http://coffee-script.org/

sass自动编译:sass --watch app/sass:public/stylesheets

原址:http://sass-lang.com/guide

 

sass coffee 和grunt的各种命令

原文:http://www.cnblogs.com/Akishimo/p/5133330.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!