代码拉取完成,页面将自动刷新
module.exports = function(grunt) {
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
paths: ["assets"]
},
files: {
"assets/css/theme.css": "assets/less/theme.less"
}
}
},
watch: {
styles: {
files: ['assets/less/**/*.less'],
tasks: ['less'],
options: {
nospawn: true
}
},
pug: {
files: ['index.pug'],
tasks: ['exec:compile_pug'],
options: {
nospawn: true
}
}
},
exec: {
run_server: {
cmd: "node serve.js"
},
build_index: {
cmd: "node render.js"
},
compile_pug: {
cmd: 'pug -c index.pug --out tpl && echo "module.exports = { renderResume: template };" >> ./tpl/index.js'
}
},
copy: {
resumejson: {
cwd: './',
src: [ 'resume.json' ],
dest: './node_modules/resume-schema',
expand: true
},
build: {
cwd: './assets/css',
src: [ 'theme.css' ],
dest: './build/assets/css',
expand: true
},
favicon: {
cwd: './',
src: [ 'favicon.ico' ],
dest: './build/',
expand: true
}
},
clean: {
build: {
src: [ 'build' ]
}
}
});
// Load the plugin that compiles less to css
grunt.loadNpmTasks('grunt-contrib-less');
// Load the plugin that watches file changes
grunt.loadNpmTasks('grunt-contrib-watch');
// Load the plugin to execute shell commands
grunt.loadNpmTasks('grunt-exec');
// Load the plugin to clean directories
grunt.loadNpmTasks('grunt-contrib-clean')
// Load the plugin to copy files
grunt.loadNpmTasks('grunt-contrib-copy');
// Default tasks
grunt.registerTask('default', ['exec']);
grunt.registerTask('build', [
/* Uncomment this item once you've created your own resume.json file
in the project root. This will use your own data to build your site.
*/
// 'copy:resumejson',
'clean',
'copy:build',
'less',
'exec:build_index', //,
/* Uncomment this item (and the comma above) if you add a favicon.ico
in the project root. You'll also need to uncomment the <link...> tag
at the top of resume.template.
*/
// 'copy:favicon'
]);
grunt.registerTask('serve', [
'build',
'exec:run_server'
]);
grunt.registerTask('compile:pug', ['exec:compile_pug']);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。