Skip to content

Instantly share code, notes, and snippets.

@yokotak0527
Created March 13, 2013 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yokotak0527/5151272 to your computer and use it in GitHub Desktop.
Save yokotak0527/5151272 to your computer and use it in GitHub Desktop.
ゆっくり喋らせる
'use strict';
// =============================================================================
// 変更点
// =============================================================================
// '<config:prop.subprop>' → '<%= prop.subprop %>'
// '<json:file.json>' → grunt.file.readJSON('file.json')
// '<file_template:file.js>' → grunt.template.process(grunt.file.read('file.js'))
module.exports = function(grunt){
//console.log('aa');
// =========================================================================
// タスクの読み込み
// =========================================================================
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-exec');
var exec = require('child_process').exec;
//grunt.task.registerTask('saykana','',function(){
// //echo 'hoge';
// exec('echo "hoge"');
// //exec('styledocco -n "style guide name" --preprocessor "sass" sass/styleguide.scss');
//});
var jsDir = 'sample/build/'; // jsのディレクトリ
var jsDestDir = 'sample/';
// =========================================================================
// initConfig
// =========================================================================
grunt.initConfig({
// ---------------------------------------------------------------------
// パッケージの指定
// ---------------------------------------------------------------------
pkg:grunt.file.readJSON('package.json'),
exec:{
start:{
command: 'saykana かいし、します',
//stdout: false,
//stderr: false
},
concat:{
command: 'saykana けつごう、しました',
//stdout: false,
//stderr: false
}
},
// ---------------------------------------------------------------------
// concatの設定
// ---------------------------------------------------------------------
concat:{
//options:{
// separator: ';'
//},
dist:{
src:[
jsDir+'header.js',
jsDir+'main.js',
jsDir+'footer.js'
],
dest:jsDestDir+'sample.js'
}
},
// ---------------------------------------------------------------------
// minの設定
// ---------------------------------------------------------------------
uglify: {
common:{
files:{
'sample/sample.min.js':'sample/sample.js'
}
}
},
// ---------------------------------------------------------------------
// watchの設定
// ---------------------------------------------------------------------
watch:{
// scriptsのビルド
scripts:{
files:['<%= concat.dist.src %>'],
tasks:[
'concat',
'exec:concat'
//'uglify'
]
}// ,
// css:{
// files:'js/*.js',
// tasks:['growl:scripts']
// }
}
// ---------------------------------------------------------------------
});
// =========================================================================
// タスクの登録
// =========================================================================
// 開発中の処理の登録
grunt.registerTask('develop',['exec:start','watch']);
// -------------------------------------------------------------------------
// 出荷用の処理の登録
grunt.registerTask('production',[
'concat',
//'uglify',
'saykana'
]);
// -------------------------------------------------------------------------
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment