運行 grunt copy 報錯 Task "copy" not found.
'use strict'
module.export=function(grunt){
//加載插件
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
//配置項目路徑
var config={
app:'app',
dist:'dist'
};
//配置項目設置
grunt.initConfig({
config:config,
//定義Task
copy:{
dist_html:{
src:'<%=config.app%>/index.html',
dest:'<%=config.dis%>/index.html'
},
dist_js:{
src:'<%=config.app%>/js/index.js',
dest:'<%=config.dis%>/js/index.js'
}
},
? ? //另一種寫法
//copy:{
? ? // ?files:[
? ? // ? ?{
? ? // ? ? ?src:'<%=config.app%>/index.html',
? ? // ? ? ?dest:'<%=config.dis%>/index.html'
? ? // ? ?},
? ? // ? ?{
? ? // ? ? ?src:'<%=config.app%>/js/index.js',
? ? // ? ? ?dest:'<%=config.dis%>/js/index.js'
? ? // ? ?}
? ? // ?]
? ? //},
clean:{
dist:{
src:['<%=config.dis%>/index.html','<%=config.dis%>/js/index.js']
}
}
});
}
2022-03-24
說得很清楚啊,/Applications/Xcode6-Beta2.app/Contents/Developer這個位置找不到,beta3你改成beta3的目錄就好了,不要告訴我你不知道哦怎么用3替換2. 1我也感覺他說反了反正效果自己知道就行了,寫哪個方向就是偏離哪個方向,不要在意這些細節
2016-11-10
因為你在dest中的路徑寫錯了,你把<%= config.dist %>寫成了<%= config.dis %>