diff --git a/package.json b/package.json index 30df225..57b13d9 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "axios": "^0.19.0", "core-js": "2.6.5", "dayjs": "^1.8.16", - "fastclick": "^1.0.6", "js-cookie": "^2.2.1", "lib-flexible": "^0.3.2", "raven-js": "^3.27.2", diff --git a/src/main.js b/src/main.js index 79378d6..f79561b 100644 --- a/src/main.js +++ b/src/main.js @@ -3,17 +3,12 @@ import 'lib-flexible' import App from './App.vue' import router from '@/router' import store from '@/store' -import FastClick from 'fastclick' import 'utils/permission' import SvgIcon from 'components/SvgIcon' import '@/icons' // icon import '@/style/common.scss' import { Lazyload } from 'vant' import defaultSettings from '@/settings' -// import * as Sentry from '@sentry/browser' -// import * as Integrations from '@sentry/integrations' -import Raven from 'raven-js' -import RavenVue from 'raven-js/plugins/vue' /** * If you don't want to use mock-server @@ -24,29 +19,11 @@ import RavenVue from 'raven-js/plugins/vue' * please remove it before going online! ! ! */ import { mockXHR } from '../mock' + if (process.env.NODE_ENV === 'production') { mockXHR() } -Raven.config('https://3a79cdaad04f491d9ff7e64001fb2b66@sentry.io/1802126', { - release: process.env.RELEASE_VERSION // 版本号与vue.config.js的一致 -}) - .addPlugin(RavenVue, Vue) - .install() -// Sentry.init({ -// dsn: 'https://3a79cdaad04f491d9ff7e64001fb2b66@sentry.io/1802126', -// integrations: [ -// new Integrations.Vue({ -// Vue, -// attachProps: true -// }), -// new Integrations.RewriteFrames() -// ], -// release: 'game-center-html@prod' -// }) - -FastClick.attach(document.body) - // options 为可选参数,无则不传 Vue.use(Lazyload) diff --git a/vue.config.js b/vue.config.js index adfdd75..db34a8a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,9 +1,7 @@ const path = require('path') const CompressionWebpackPlugin = require('compression-webpack-plugin') const UglifyjsWebpackPlugin = require('uglifyjs-webpack-plugin') -const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') -const gitSha = require('child_process').execSync('git rev-parse HEAD').toString().trim() // 这个是获取提交版本的记录 -const SentryWebpackPlugin = require('@sentry/webpack-plugin') +// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') const port = process.env.port || process.env.npm_config_port || 8888 const cdnDomian = './' // cdn域名,如果有cdn修改成对应的cdn const name = 'H5Vue' // page title @@ -19,8 +17,6 @@ const cdn = { ] } -process.env.RELEASE_VERSION = gitSha - const externals = { vue: 'Vue', 'vue-router': 'VueRouter', @@ -38,7 +34,7 @@ module.exports = { outputDir: 'dist', assetsDir: 'static', lintOnSave: process.env.NODE_ENV === 'development', - productionSourceMap: true, + productionSourceMap: false, devServer: { port: port, open: true, @@ -147,14 +143,6 @@ module.exports = { } ) if (IS_PRODUCTION) { - config.plugin('sentry').use(SentryWebpackPlugin, [{ - ignore: ['node_modules'], - include: './dist', // 上传dist文件的js - configFile: './.sentryclirc', // 配置文件地址 - release: process.env.RELEASE_VERSION, // 版本号 - deleteAfterCompile: true, - urlPrefix: 'http://h5vue.cixi518.com/static/js' // cdn js的代码路径前缀 - }]) // config.plugin('analyzer').use(BundleAnalyzerPlugin) config.plugin('html').tap(args => { args[0].cdn = cdn @@ -180,7 +168,7 @@ module.exports = { new UglifyjsWebpackPlugin({ // 生产环境推荐关闭 sourcemap 防止源码泄漏 // 服务端通过前端发送的行列,根据 sourcemap 转为源文件位置 - sourceMap: true, + // sourceMap: true, uglifyOptions: { warnings: false, compress: {