Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main.js
#	vue.config.js
  • Loading branch information
lujiehui committed Apr 30, 2020
2 parents d3acff1 + 73a56ae commit e9f4165
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 40 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 1 addition & 24 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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://[email protected]/1802126', {
release: process.env.RELEASE_VERSION // 版本号与vue.config.js的一致
})
.addPlugin(RavenVue, Vue)
.install()
// Sentry.init({
// dsn: 'https://[email protected]/1802126',
// integrations: [
// new Integrations.Vue({
// Vue,
// attachProps: true
// }),
// new Integrations.RewriteFrames()
// ],
// release: 'game-center-html@prod'
// })

FastClick.attach(document.body)

// options 为可选参数,无则不传
Vue.use(Lazyload)

Expand Down
18 changes: 3 additions & 15 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,8 +17,6 @@ const cdn = {
]
}

process.env.RELEASE_VERSION = gitSha

const externals = {
vue: 'Vue',
'vue-router': 'VueRouter',
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -180,7 +168,7 @@ module.exports = {
new UglifyjsWebpackPlugin({
// 生产环境推荐关闭 sourcemap 防止源码泄漏
// 服务端通过前端发送的行列,根据 sourcemap 转为源文件位置
sourceMap: true,
// sourceMap: true,
uglifyOptions: {
warnings: false,
compress: {
Expand Down

0 comments on commit e9f4165

Please sign in to comment.