123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- const path = require('path')
- const isProdMode = Object.is(process.env.NODE_ENV, 'production')
- const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://192.168.253.60:9090/platform-b2c/' : 'http://10.1.51.125:8080/platform-b2c/')
- const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
- module.exports = {
- router: {
- middleware: 'check-auth'
- },
-
- head: {
- title: '【优软商城】IC电子元器件现货采购交易平台商城',
- meta: [
- { charset: 'utf-8' },
- { 'http-equiv': 'X-UA-Compatible', content: 'IE=edge,chrome=1' },
- { name: 'render', content: 'webkit' },
- { name: 'viewport', content: 'width=device-width, initial-scale=1' },
- { hid: 'description', name: 'description', content: '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!' }
- ],
- link: [
- { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
- ]
- },
-
- loading: '~components/common/loading/Loading.vue',
-
- build: {
-
- extend (config, { dev, isClient, isServer }) {
- config.resolve.alias['~utils'] = path.join(__dirname, 'utils')
- config.module.rules.push({
- test: /\.(scss|css)$/,
- loader: 'vue-style-loader!css-loader!sass-loader'
- })
- config.module.rules.push({
- test: /\.js$/,
- loader: 'babel-loader'
- })
- if (isClient) {
- config.module.rules.push({
- enforce: 'pre',
- test: /\.(js|vue)$/,
- loader: 'eslint-loader',
- exclude: /(node_modules)/
- })
- }
- },
- vendor: [
- 'axios',
- 'swiper',
- 'element-ui'
- ],
- babel: {
- presets: ['es2015', 'stage-2'],
- plugins: [
- 'transform-async-to-generator',
- 'transform-runtime'
- ],
- comments: true
- },
- postcss: [
- require('autoprefixer')({
- browsers: ['last 3 versions']
- })
- ]
- },
- css: [
- { src: '~assets/scss/app.scss', lang: 'scss' }
-
-
- ],
- dev: !isProdMode,
- env: {
- baseUrl,
- commonUrl
- },
- plugins: [{
- src: '~plugins/axios.js'
- }, {
- src: '~plugins/swiper.js',
- ssr: false
- }, {
- src: '~plugins/vue-loading.js',
- ssr: false
- }, {
- src: '~plugins/vue-empty.js',
- ssr: false
- }, {
- src: '~plugins/element-ui.js',
- ssr: true
- }, {
- src: '~plugins/filters.js',
- ssr: false
- }, {
- src: '~plugins/jsonp.js',
- ssr: false
- }, {
- src: '~plugins/vue-filter.js',
- ssr: false
- }],
-
-
- proxyTable: {
- '/api/**': baseUrl,
- '/search/**': baseUrl,
- '/user/**': baseUrl,
- '/user**': baseUrl,
- '/login/**': baseUrl,
- '/register/**': baseUrl,
- '/logout/**': baseUrl,
- '/static/**': baseUrl,
- '/vendor**': baseUrl,
- '/trade/**': baseUrl,
- '/recommendation/**': baseUrl,
- '/store-service/**': baseUrl,
- '/basic/**': baseUrl,
- '/logout**': baseUrl,
- '/operation/**': baseUrl,
- '/help**': baseUrl,
- '/product**': baseUrl,
- '/store**': baseUrl,
- '/order/proxy**': baseUrl,
- '/report/**': baseUrl,
- '/store/**#/**': baseUrl,
- '/kdn/**': baseUrl,
- '/product/**Submit': baseUrl,
- '/admin**': baseUrl,
- '/product/**Submit/**': baseUrl,
- '/release/**': baseUrl,
- '/auth/store/**': baseUrl,
- '/produce/**': baseUrl,
- '/file**': baseUrl,
- '/rate/**': baseUrl,
- '/log/**': baseUrl,
- '/help-service/**': baseUrl,
- '/keyword/**': baseUrl,
- '/tip/**': baseUrl,
- '/UASBatchPutOnProperty**': baseUrl,
- '/UASBatchPutOnProperty/**': baseUrl,
- '/seek/**': baseUrl,
- '/inquiry/**': commonUrl
- }
- }
|