運(yùn)行 grunt copy 報(bào)錯(cuò) Task "copy" not found.
'use strict'
module.export=function(grunt){
//加載插件
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
//配置項(xiàng)目路徑
var config={
app:'app',
dist:'dist'
};
//配置項(xiàng)目設(shè)置
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'
}
},
? ? //另一種寫(xiě)法
//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
說(shuō)得很清楚啊,/Applications/Xcode6-Beta2.app/Contents/Developer這個(gè)位置找不到,beta3你改成beta3的目錄就好了,不要告訴我你不知道哦怎么用3替換2. 1我也感覺(jué)他說(shuō)反了反正效果自己知道就行了,寫(xiě)哪個(gè)方向就是偏離哪個(gè)方向,不要在意這些細(xì)節(jié)
2016-11-10
因?yàn)槟阍赿est中的路徑寫(xiě)錯(cuò)了,你把<%= config.dist %>寫(xiě)成了<%= config.dis %>