1 Star 0 Fork 0

梁行知/jsonresume-theme-elegant

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Gruntfile.js 2.98 KB
一键复制 编辑 原始数据 按行查看 历史
Mudassir Ali 提交于 2019-10-10 03:10 . separate compilation and rendering
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']);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/freemo/jsonresume-theme-elegant.git
git@gitee.com:freemo/jsonresume-theme-elegant.git
freemo
jsonresume-theme-elegant
jsonresume-theme-elegant
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385