Toggle navigation
我的博客
首页
文章列表
留言板
登录
注册
首页
工作总结
文章
作业
作者:
gaohan
•
2022年06月07日
阅读 (785)
### svn地址
1. 智能作业: https://svn.iclass30.com/svn/datedu-hw/homeWork
2. 作业客户端: https://svn.iclass30.com/svn/datedu-hw/hkclient/Release/html
3. 报告:https://svn.iclass30.com/svn/datedu-web/datedu-web-manage/homework
4. 切题: https://svn.iclass30.com/svn/datedu-hw/cutTestPaper
**作业打包流程**:
**1)**切题打包
使用grunt打包,将gruntFile.js文件,package.json文件置于外层, 依次执行以下命令
`npm install grunt -g`
`npm install`
`grunt`
打包完成后复制dist中的文件到homework项目static替换对应文件
**2)**报告打包,打包完成后复制dist中的文件替换hkclient项目html/report中的对应文件
**3)**作业打包,homework项目执行 `npm run build-pc` 命令,打包完成后将dist中的文件复制到hkclient项目html\teaHomeWork中
**4)**压缩包打包,回到hkclient\html\teaHomeWork目录,将report,teaHomeWork,app.json三个文件生成dist.zip即可,之后发给对应测试上架智能作业PC端
**说明:** 作业版本号对应埋点版本号,app.json中的version对应版本号,大版本现网上线时,需要更改埋点号+1并提交app,json文件,测网不需要
作业打包:
客户端,web端: npm run build
金陵渠道: npm run build:jlwx
pc包: npm run build-pc
报告打包:
web端: npm run build
客户端: npm run build:zy
说明: 作业版本号对应埋点版本号,app.json对应版本号
构建工具: grunt
学生作业打包问题: 错题本: npm run build wrongPaper
#### # grunt art-template ejs node IndexedDb serverWorker 新线程worker canvas fabric i18n jsbridge mathjax mathquill v-viewer
```javascript
'use strict';
module.exports = function (grunt) {
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Automatically load required grunt tasks
require('jit-grunt')(grunt, {
useminPrepare: 'grunt-usemin'
});
// Configurable paths
var config = {
html: 'html',
dist: 'dist',
uglifySrc:['{,**/}js/testbank/*.js','{,**/}js/util/*.js'],
target: '', // 目标项目,*代表全部项目 对应单个项目的文件夹
src: 'cutTestPaper' // 源目录路径
};
// Define the configuration for all the tasks
grunt.initConfig({
// Project settings
config: config,
// Empties folders to start fresh
clean: {
dist: {
files: [{
dot: true,
src: [
'<%= config.dist %>/<%= config.target %>'
]
}]
}
},
// Copies remaining files to places other tasks can use
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= config.src %>',
src: '**',
dest: '<%= config.dist %>/<%= config.target %>'
}]
}
},
cssmin: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= config.dist %>/<%= config.target %>',
src: ['{,**/}*.css','!{,**/}js/thirdLib/*'],
dest: '<%= config.dist %>/<%= config.target %>'
}]
}
},
babel: {
options: {
sourceMap: false,
presets: ['es2015']
},
dist: {
files: [{
expand:true,
cwd: '<%= config.dist %>/<%= config.target %>', //js目录下
src:['{,**/}*.js','!{,**/}js/thirdLib/*'], //所有js文件
dest: '<%= config.dist %>/<%= config.target %>' //输出到此目录下
}]
}
},
uglify: {
options: {
mangle: true, //混淆变量名
comments: 'false' //false(删除全部注释),some(保留@preserve @license @cc_on等注释)
},
build: {
files: [{
expand: true,
dot: true,
cwd: '<%= config.dist %>/<%= config.target %>',
src: config.uglifySrc,
dest: '<%= config.dist %>/<%= config.target %>'
}]
}
},
htmlmin: {
dist: {
options: {
removeComments: true,
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true
},
files: [{
expand: true,
dot: true,
cwd: '<%= config.dist %>/<%= config.target %>',
dest: '<%= config.dist %>/<%= config.target %>',
src: ['{,**/}*.html', '!{,**/}js/thirdLib/*']
}]
}
},
concurrent: {
dist: [
'cssmin',
'htmlmin',
//'babel',
'uglify'
]
}
});
grunt.registerTask('default', function (target) {
grunt.task.run([
'clean',
'copy:dist',
'concurrent:dist'
])
});
};
```
© 著作权归作者所有
分类
工作总结
标签