Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
nuxt.config.js 4.52 KB
Copy Edit Raw Blame History
晓言 authored 2021-10-25 12:14 . 测试
const { resolve } = require('path')
const pkg = require('./package')
global.HTMLElement = typeof window === 'undefined' ? Object : window.HTMLElement
export default {
mode: 'spa',
env: {
ENV_PRODUCT: process.env.ENV_PRODUCT
},
server: {
port: 8090, // default: 3000
host: '0.0.0.0' // default: localhost
},
/*
** Headers of the page
*/
head: {
title: pkg.title,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/logo1.ico' },
{ rel: 'stylesheet', href: '/swiper/swiper.min.css' }
],
script: [
{ src: 'https://hm.baidu.com/hm.js?82c11fd530815e303d1d612a3ab9f88d' },
{ src: 'https://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js' },
{ src: '/swiper/swiper.min.js' },
{ src: '/js/xlsx.core.min.js' },
{ src: '/js/xlsx.js' },
{ src: '/js/jszip.js' },
{ src: '/3d-force-graph/3d-force-graph.min.js' },
{ src: '/3d-force-graph/three.js' },
{ src: '/3d-force-graph/three-spritetext.min.js' }
]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: ['@/assets/main.css'],
/*
** Plugins to load before mounting the App
*/
plugins: [
'@/plugins/element-ui',
'@/plugins/svg-icon',
'@/plugins/axios',
'@/plugins/vue-map',
'@/plugins/vue-elementui-bigdata-table',
'@/plugins/datav',
'@/plugins/baiduhm'
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
// Doc: https://www.npmjs.com/package/@nuxtjs/markdownit
'@nuxtjs/markdownit'
// // https://github.com/schlunsen/nuxt-leaflet
// 'nuxt-leaflet'
],
/*
** Axios module configuration
*/
axios: {
// See https://github.com/nuxt-community/axios-module#options
proxy: true // Can be also an object with default options
},
proxy: {
//'/filesys': 'http://172.16.35.242:8000/',
// 服务器调试
//'/api': 'http://172.16.35.242:8082'
// 服务器调试
'/api-dg': 'https://hehu.91xunbang.cn:3000',
// '/api': 'http://192.168.102.23:8082',
// 本地调试
// '/api': 'http://localhost:8082',
// '/api-dg':'https://hehu.zjwater.com:10443',
'api': 'http://192.168.2.232',
'/files': {
// target: 'https://192.168.102.23:8084',
target: 'http://localhost:80',
changeOrigin: true
},
'/mlhh': {
// target: 'https://192.168.102.23:8084',
target: 'https://192.168.102.23:8084/files/mlhh',
changeOrigin: true
},
'/geocode': 'https://restapi.amap.com/v3',
'/arcgis': 'https://192.168.102.23:8084',
// '/arcgis': 'http://192.168.101.1:6080',
'/tiandituURL': {
target: 'http://t1.tianditu.gov.cn', // 设置调用接口域名和端口号别忘了加http
changeOrigin: true,
pathRewrite: {
'^/tiandituURL': '/'
}
}
// 本地调试
// '/api': 'http://localhost:8082'
},
/*
** markdownit module configuration
*/
markdownit: {
// See https://github.com/markdown-it/markdown-it
injected: true,
preset: 'default',
linkify: true,
breaks: true,
use: [
// ['markdown-it-container', containerName],
// 'markdown-it-attrs'
]
},
/*
** 路由
*/
router: {
middleware: 'agent',
// extendRoutes(routes, resolve) {
// routes.push({
// // name: 'index',
// path: '/',
// redirect: '/oldIndex',
// // component: resolve(__dirname, 'pages/oldIndex.vue')
// })
// }
},
/*
** Build configuration
*/
build: {
transpile: [/^element-ui/],
/*
** You can extend webpack config here
*/
extend(config, ctx) {
const svgRule = config.module.rules.find(rule => rule.test.test('.svg'))
svgRule.exclude = [resolve(__dirname, 'assets/svg')]
// Includes /assets/svg for svg-sprite-loader
config.module.rules.push({
test: /\.svg$/,
include: [resolve(__dirname, 'assets/svg')],
loader: 'svg-sprite-loader',
options: {
symbolId: 'icon-[name]'
}
})
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
// config.module.rules.push({
// enforce: 'pre',
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// exclude: /(node_modules)/
// })
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化