修改 package.json

This commit is contained in:
GYJ 2024-12-03 09:22:14 +08:00
parent 1b5e5ecf3d
commit 25f2d28925
3 changed files with 3888 additions and 1491 deletions

View File

@ -1,66 +1,102 @@
var gulp = require('gulp'); var gulp = require('gulp')
var $ = require('gulp-load-plugins')(); var $ = require('gulp-load-plugins')()
var path = require('path'); var path = require('path')
var del = require('del'); var del = require('del')
var distPath = path.resolve('./dist'); var distPath = path.resolve('./dist')
var version = ''; // 版本号 var version = '' // 版本号
var versionPath = ''; // 版本号路径 var versionPath = '' // 版本号路径
var env = ''; // 运行环境 var env = ''; // 运行环境
// 创建版本号(年月日时分) // 创建版本号(年月日时分)
(function () { (function () {
var d = new Date(); var d = new Date()
var yy = d.getFullYear().toString().slice(2); var yy = d.getFullYear().toString().slice(2)
var MM = d.getMonth() + 1 >= 10 ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1); var MM = d.getMonth() + 1 >= 10 ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1)
var DD = d.getDate() >= 10 ? d.getDate() : '0' + d.getDate(); var DD = d.getDate() >= 10 ? d.getDate() : '0' + d.getDate()
var h = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours(); var h = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours()
var mm = d.getMinutes() >= 10 ? d.getMinutes() : '0' + d.getMinutes(); var mm = d.getMinutes() >= 10 ? d.getMinutes() : '0' + d.getMinutes()
version = yy + MM + DD + h + mm; version = yy + MM + DD + h + mm
versionPath = distPath + '/' + version; versionPath = distPath + '/' + version
})(); })()
// 编译 // 编译
gulp.task('build', $.shell.task([ 'node build/build.js' ])); gulp.task('build', $.shell.task(['node build/build.js']))
// 创建版本号目录 // 创建版本号目录
gulp.task('create:versionCatalog', ['build'], function () { gulp.task('create:versionCatalog', gulp.series('build', function () {
return gulp.src(`${distPath}/static/**/*`) return gulp.src(`${distPath}/static/**/*`)
.pipe(gulp.dest(`${versionPath}/static/`)) .pipe(gulp.dest(`${versionPath}/static/`))
}); }))
// 替换${versionPath}/static/js/manifest.js window.SITE_CONFIG.cdnUrl占位变量 // 替换${versionPath}/static/js/manifest.js window.SITE_CONFIG.cdnUrl占位变量
gulp.task('replace:cdnUrl', ['create:versionCatalog'], function () { gulp.task('replace:cdnUrl', gulp.series('create:versionCatalog', function () {
return gulp.src(`${versionPath}/static/js/manifest.js`) return gulp.src(`${versionPath}/static/js/manifest.js`)
.pipe($.replace(new RegExp(`"${require('./config').build.assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"')) .pipe($.replace(new RegExp(`"${require('./config').build.assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"'))
.pipe(gulp.dest(`${versionPath}/static/js/`)) .pipe(gulp.dest(`${versionPath}/static/js/`))
}); }))
// 替换${versionPath}/static/config/index-${env}.js window.SITE_CONFIG['version']配置变量 // 替换${versionPath}/static/config/index-${env}.js window.SITE_CONFIG['version']配置变量
gulp.task('replace:version', ['create:versionCatalog'], function () { gulp.task('replace:version', gulp.series('create:versionCatalog', function () {
return gulp.src(`${versionPath}/static/config/index-${env}.js`) return gulp.src(`${versionPath}/static/config/index-${env}.js`)
.pipe($.replace(/window.SITE_CONFIG\['version'\] = '.*'/g, `window.SITE_CONFIG['version'] = '${version}'`)) .pipe($.replace(/window.SITE_CONFIG\['version'\] = '.*'/g, `window.SITE_CONFIG['version'] = '${version}'`))
.pipe(gulp.dest(`${versionPath}/static/config/`)) .pipe(gulp.dest(`${versionPath}/static/config/`))
}); }))
// 合并${versionPath}/static/config/[index-${env}, init].js 至 ${distPath}/config/index.js // 合并${versionPath}/static/config/[index-${env}, init].js 至 ${distPath}/config/index.js
gulp.task('concat:config', ['replace:version'], function () { gulp.task('concat:config', gulp.series('replace:version', function () {
return gulp.src([`${versionPath}/static/config/index-${env}.js`, `${versionPath}/static/config/init.js`]) return gulp.src([`${versionPath}/static/config/index-${env}.js`, `${versionPath}/static/config/init.js`])
.pipe($.concat('index.js')) .pipe($.concat('index.js'))
.pipe(gulp.dest(`${distPath}/config/`)) .pipe(gulp.dest(`${distPath}/config/`))
}); }))
// 清空 // 清空文件历史
gulp.task('clean', function () { gulp.task('clean', function () {
return del([versionPath]) console.log('--clean--')
}); // del([`${distPath}/static`, `${versionPath}/static/config`]);
// return del([versionPath])
return del([`${distPath}`])
})
gulp.task('default', ['clean'], function () { gulp.task('build-end', function () {
console.log('--builed-end--')
// del([`${distPath}/static`, `${versionPath}/static/config`]);
return del([`${distPath}/static`, `${versionPath}/static/config`]);
})
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
gulp.task('default',
gulp.series('clean',
gulp.parallel('create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config'),
'build','build-end')
)
/* gulp.task('default', gulp.series('clean', function (done) {
// 获取环境配置 // 获取环境配置
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod' env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
// 开始打包编译 // 开始打包编译
gulp.start(['build', 'create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config'], function () { // 开始打包编译
gulp.task('default', gulp.series('build','create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config', function (done) {
// 清除, 编译 / 处理项目中产生的文件 // 清除, 编译 / 处理项目中产生的文件
del([`${distPath}/static`, `${versionPath}/static/config`]) del([`${distPath}/static`, `${versionPath}/static/config`])
}) done();
}); }))
})); */
/*
gulp.task('default', gulp.series('clean', function (done) {
// 获取环境配置
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
// 开始打包编译
// 开始打包编译
gulp.task('default', gulp.series('build','create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config', function (done) {
// 清除, 编译 / 处理项目中产生的文件
del([`${distPath}/static`, `${versionPath}/static/config`])
done();
}))
}));
*/

5042
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,108 +1,109 @@
{ {
"name": "sz-fast-vue", "name": "sqx",
"version": "1.2.2", "version": "1.2.2",
"description": "sz-fast-vue基于vue、element-ui构建开发实现sz-fast后台管理前端功能提供一套更优的前端解决方案。", "author": "maxd",
"author": "daxiong.yang <daxiong.yang@qq.com>", "private": true,
"private": true, "scripts": {
"scripts": { "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", "start": "npm run dev",
"start": "npm run dev", "unit": "jest --config test/unit/jest.conf.js --coverage",
"unit": "jest --config test/unit/jest.conf.js --coverage", "e2e": "node test/e2e/runner.js",
"e2e": "node test/e2e/runner.js", "test": "npm run unit && npm run e2e",
"test": "npm run unit && npm run e2e", "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs", "build": "gulp"
"build": "gulp" },
}, "dependencies": {
"dependencies": { "axios": "0.17.1",
"axios": "^0.17.1", "babel-plugin-component": "0.10.1",
"babel-plugin-component": "0.10.1", "babel-polyfill": "6.26.0",
"babel-polyfill": "6.26.0", "clipboard": "^2.0.11",
"clipboard": "^2.0.11", "echarts": "^5.5.1",
"element-china-area-data": "^5.0.2", "element-china-area-data": "^5.0.2",
"element-ui": "2.8.2", "element-ui": "2.8.2",
"fs": "0.0.1-security", "fs": "0.0.1-security",
"gulp": "3.9.1", "gulp-concat": "2.6.1",
"gulp-concat": "2.6.1", "gulp-load-plugins": "1.5.0",
"gulp-load-plugins": "1.5.0", "gulp-replace": "0.6.1",
"gulp-replace": "0.6.1", "hls.js": "^1.5.17",
"gulp-shell": "0.6.5", "lodash": "4.17.5",
"hls.js": "^1.4.12", "mockjs": "^1.1.0",
"lodash": "4.17.5", "npm": "^6.9.0",
"npm": "^6.9.0", "sass-loader": "6.0.6",
"sass-loader": "6.0.6", "svg-sprite-loader": "3.7.3",
"svg-sprite-loader": "3.7.3", "video.js": "^8.20.0",
"video.js": "^8.5.2", "videojs-contrib-hls": "^5.15.0",
"videojs-contrib-hls": "^5.15.0", "vue": "2.5.16",
"vue": "2.5.16", "vue-baidu-map": "^0.21.22",
"vue-baidu-map": "^0.21.22", "vue-cookie": "1.1.4",
"vue-cookie": "1.1.4", "vue-jsonp": "^2.0.0",
"vue-jsonp": "^2.0.0", "vue-quill-editor": "^3.0.6",
"vue-quill-editor": "^3.0.6", "vue-router": "3.0.1",
"vue-router": "3.0.1", "vuex": "3.0.1"
"vuex": "3.0.1" },
}, "devDependencies": {
"devDependencies": { "autoprefixer": "7.1.2",
"autoprefixer": "7.1.2", "babel-core": "6.22.1",
"babel-core": "6.22.1", "babel-eslint": "7.1.1",
"babel-eslint": "7.1.1", "babel-jest": "21.0.2",
"babel-jest": "21.0.2", "babel-loader": "7.1.1",
"babel-loader": "7.1.1", "babel-plugin-dynamic-import-node": "1.2.0",
"babel-plugin-dynamic-import-node": "1.2.0", "babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.0", "babel-plugin-transform-runtime": "6.22.0",
"babel-plugin-transform-runtime": "6.22.0", "babel-preset-env": "1.3.2",
"babel-preset-env": "1.3.2", "babel-preset-stage-2": "6.22.0",
"babel-preset-stage-2": "6.22.0", "babel-register": "6.22.0",
"babel-register": "6.22.0", "chalk": "2.3.0",
"chalk": "2.3.0", "copy-webpack-plugin": "4.0.1",
"copy-webpack-plugin": "4.0.1", "cross-spawn": "5.0.1",
"cross-spawn": "5.0.1", "css-loader": "0.28.0",
"css-loader": "0.28.0", "eslint": "3.19.0",
"eslint": "3.19.0", "eslint-config-standard": "10.2.1",
"eslint-config-standard": "10.2.1", "eslint-friendly-formatter": "3.0.0",
"eslint-friendly-formatter": "3.0.0", "eslint-loader": "1.7.1",
"eslint-loader": "1.7.1", "eslint-plugin-html": "3.0.0",
"eslint-plugin-html": "3.0.0", "eslint-plugin-import": "2.7.0",
"eslint-plugin-import": "2.7.0", "eslint-plugin-node": "5.2.0",
"eslint-plugin-node": "5.2.0", "eslint-plugin-promise": "3.5.0",
"eslint-plugin-promise": "3.5.0", "eslint-plugin-standard": "3.0.1",
"eslint-plugin-standard": "3.0.1", "eventsource-polyfill": "0.9.6",
"eventsource-polyfill": "0.9.6", "extract-text-webpack-plugin": "^3.0.2",
"extract-text-webpack-plugin": "3.0.0", "file-loader": "1.1.4",
"file-loader": "1.1.4", "friendly-errors-webpack-plugin": "1.6.1",
"friendly-errors-webpack-plugin": "1.6.1", "gulp": "^4.0.2",
"html-webpack-plugin": "2.30.1", "gulp-shell": "^0.6.5",
"jest": "21.2.0", "html-webpack-plugin": "2.30.1",
"jest-serializer-vue": "0.3.0", "jest": "21.2.0",
"nightwatch": "0.9.12", "jest-serializer-vue": "0.3.0",
"node-notifier": "5.1.2", "nightwatch": "0.9.12",
"node-sass": "^4.14.1", "node-notifier": "5.1.2",
"optimize-css-assets-webpack-plugin": "3.2.0", "node-sass": "^4.14.1",
"ora": "1.2.0", "optimize-css-assets-webpack-plugin": "3.2.0",
"portfinder": "1.0.13", "ora": "1.2.0",
"postcss-import": "11.0.0", "portfinder": "1.0.13",
"postcss-loader": "2.0.8", "postcss-import": "11.0.0",
"rimraf": "2.6.0", "postcss-loader": "2.0.8",
"selenium-server": "3.0.1", "rimraf": "2.6.0",
"semver": "5.3.0", "selenium-server": "3.0.1",
"shelljs": "0.7.6", "semver": "5.3.0",
"uglifyjs-webpack-plugin": "1.1.1", "shelljs": "0.7.6",
"url-loader": "0.5.8", "uglifyjs-webpack-plugin": "1.1.1",
"vue-jest": "1.0.2", "url-loader": "0.5.8",
"vue-loader": "13.3.0", "vue-jest": "1.0.2",
"vue-style-loader": "3.0.1", "vue-loader": "13.3.0",
"vue-template-compiler": "2.5.16", "vue-style-loader": "3.0.1",
"webpack": "3.6.0", "vue-template-compiler": "2.5.16",
"webpack-bundle-analyzer": "2.9.0", "webpack": "3.6.0",
"webpack-dev-server": "2.9.1", "webpack-bundle-analyzer": "2.9.0",
"webpack-merge": "4.1.0" "webpack-dev-server": "^2.9.7",
}, "webpack-merge": "4.1.0"
"engines": { },
"node": ">= 8.11.1", "engines": {
"npm": ">= 5.6.0" "node": ">= 8.11.1",
}, "npm": ">= 5.6.0"
"browserslist": [ },
"> 1%", "browserslist": [
"last 2 versions", "> 1%",
"not ie <= 8" "last 2 versions",
] "not ie <= 8"
]
} }