| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- const webpack = require('webpack')
- module.exports = {
- srcDir: 'src/',
- // rootDir: './',
- /*
- ** Router config
- */
- router: {
- middleware: [
- 'check-auth'
- ]
- },
- /*
- ** Headers of the page
- */
- head: {
- title: '市场管理信息系统',
- meta: [{
- charset: 'utf-8'
- },
- {
- name: 'viewport',
- content: 'width=device-width, initial-scale=1'
- },
- {
- hid: 'description',
- name: 'description',
- content: '市场管理信息系统'
- }
- ],
- link: [{
- rel: 'icon',
- type: 'image/x-icon',
- href: '/favicon.ico'
- },
- // {
- // rel: 'stylesheet',
- // href: '/src/assets/styles/common.css',
- // }
- ],
- script: [{
- src: '/js/utils.js'
- },
- {
- src: '/js/printUtilities.js'
- },
- {
- src: '/js/webSiteManage.js'
- }
- ],
- },
- /*
- ** Customize the progress bar color
- */
- loading: {
- color: '#3B8070'
- },
- /*
- ** Build configuration
- */
- build: {
- babel: {
- plugins: ['transform-decorators-legacy', 'transform-class-properties']
- },
- extend(config, {
- isDev,
- isClient
- }) {
- config.resolve.alias['class-component'] = '@/plugins/class-component'
- },
- /*
- ** Run ESLint on save
- */
- // extend (config, ctx) {
- // if (ctx.dev && ctx.isClient) {
- // config.module.rules.push({
- // enforce: 'pre',
- // test: /\.(js|vue)$/,
- // loader: 'eslint-loader',
- // exclude: /(node_modules)/
- // })
- // }
- // },
- vendor: [
- // 'axios',
- 'element-ui',
- 'negotiator',
- 'vue-class-component',
- 'vuex-class',
- 'vue-i18n',
- 'vue-chartjs',
- 'vue-clipboards',
- 'moment',
- 'chart.js',
- 'highcharts',
- 'deepmerge' // vue-chartjs dep
- ],
- extractCSS: true,
- filenames: {
- vendor: 'vendor.[hash:12].js',
- app: 'shanlan.[chunkhash:12].js',
- css: 'shanlan.[contenthash:12].css'
- },
- plugins: [
- new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /zh|en/)
- ]
- },
- /*
- ** Global CSS
- */
- css: [
- // 'normalize.css/normalize.css',
- 'element-ui/lib/theme-chalk/index.css',
- '~assets/styles/common.css',
- {
- src: '~assets/styles/main.scss',
- lang: 'scss'
- }
- // {src: '~assets/mstyles/index.scss', lang: 'scss'}
- ],
- /*
- ** Add element-ui in our app, see plugins/element-ui.js file
- */
- plugins: [
- '@/plugins/i18n',
- '@/plugins/element-ui',
- '@/plugins/mycomponents',
- // '@/plugins/axios-defaults',
- {
- src: '@/plugins/clipboard',
- ssr: false
- },
- {
- src: '@/plugins/error-handler',
- ssr: false
- },
- {
- src: '@/plugins/vue-print-nb',
- ssr: false
- },
- {
- src: '@/plugins/hight-charts',
- ssr: false
- }
- ],
- modules: [
- // '@nuxtjs/auth',
- '~/modules/auth',
- '@nuxtjs/axios',
- ],
- auth: {
- user: {
- endpoint: 'users/me',
- propertyName: '',
- resetOnFail: true
- },
- login: {
- endpoint: 'auth'
- },
- logout: {
- endpoint: 'auth/logout',
- method: 'GET'
- },
- redirect: {
- notLoggedIn: '/login',
- loggedIn: '/'
- },
- token: {
- enabled: true,
- type: 'Bearer',
- localStorage: true,
- name: 'token',
- cookie: true,
- cookieName: 'token'
- }
- },
- axios: {
- // baseURL: '//192.168.1.44:10091/api/' // 本机开发使用
- baseURL: '//localhost:10091/api/' // 本机开发使用
- // baseURL: '//192.168.1.41:10091/api/' // 本机开发使用
- // baseURL: '//192.168.124.10:10091/api/' // 本机开发使用
- /* --------Nuxt Start发版用 START-------------- */
- // baseURL: '/api/'
- /* --------Nuxt Start发版用 END-------------- */
- },
- /*
- ** 客户端和服务端共享的环境变量,
- ** 客户端使用:process.env.appclient 服务端使用:context.appclien
- */
- env: {
- appclient: 'gfgl', //供方管理系统
- imgserverhost: 'http://52.80.133.197:9081', //BioBank服务地址,图片上传文件
- upfilehost: 'http://weed1.labsop.cn:9333/dir/assign', //附件上传
- baseURL: '//localhost:10091/api/' //工作流图片
- /* --------Nuxt Start发版用 START-------------- */
- //
- // appclient: 'gfgl', //供方信息管理平台
- // upfilehost: '/uploadfile', //附件上传
- // baseURL: '/api/', //本地工作流图片
- // LOCAL_IP: '10.76.248.23' //定义服务器内网IP,word转PDF时用到
- // // API_URL: 'http://10.76.248.23:10091/api/' //服务器渲染时调用
- /* --------Nuxt Start发版用 END-------------- */
- },
- }
|