123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- import path from 'path'
- import fs from 'fs'
- console.log(process.env.BASE_URL)
- export default {
- router: {
- middleware: ['intercept'],
- },
- // Global page headers: https://go.nuxtjs.dev/config-head
- head: {
- title: '认证通',
- htmlAttrs: {
- lang: 'zh-cn',
- },
- meta: [
- { charset: 'utf-8' },
- { name: 'viewport', content: 'width=device-width, initial-scale=1' },
- { name: 'description', content: '认证通|一款专业的正品认证SaaS软件系统' },
- { name: 'format-detection', content: 'telephone=no' },
- ],
- // link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
- script: [
- process.env.NODE_ENV === 'production'
- ? {
- src: '/baidu.count.js',
- }
- : '',
- {
- src: '/map.config.js',
- },
- {
- src: 'https://webapi.amap.com/maps?v=2.0&key=eae3be059db26dc1f9cae1d1bee9d4cb',
- },
- {
- src: 'https://api.map.baidu.com/api?v=2.0&&type=webgl&ak=9kNcqnkFxlS0Kv9jEbDgwG2BAMrD6wPb',
- },
- {
- src: 'https://res.wx.qq.com/open/js/jweixin-1.6.0.js',
- },
- ],
- },
- // Global CSS: https://go.nuxtjs.dev/config-css
- css: [
- // 'vant/lib/index.css',
- // 'element-ui/lib/theme-chalk/index.css',
- '~/assets/css/iconfont.css',
- 'swiper/css/swiper.css',
- 'animate.css/animate.min.css',
- '~/assets/css/global.css',
- 'three-dots/dist/three-dots.min.css',
- ],
- // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
- plugins: [
- '~/plugins/vant',
- '~/plugins/element-ui',
- '~/plugins/axios',
- '~/plugins/vue-filters',
- '~/plugins/storage',
- '~/plugins/jssdk',
- '~/plugins/router',
- ],
- // Auto import components: https://go.nuxtjs.dev/config-components
- components: true,
- // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
- buildModules: [
- '@nuxtjs/style-resources',
- // https://go.nuxtjs.dev/tailwindcss
- '@nuxtjs/tailwindcss',
- ],
- // Modules: https://go.nuxtjs.dev/config-modules
- modules: [
- // https://go.nuxtjs.dev/axios
- '@nuxtjs/axios',
- ],
- // Axios module configuration: https://go.nuxtjs.dev/config-axios
- axios: {
- // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
- baseURL: process.env.BASE_URL,
- },
- styleResources: {
- scss: ['~/assets/css/utils.scss', '~/assets/themes/themeMixin.scss'],
- },
- // Build Configuration: https://go.nuxtjs.dev/config-build
- build: {
- extractCSS: true,
- filenames: {
- chunk: ({ isDev }) => (isDev ? '[name].js' : '[id].[contenthash].js'),
- },
- },
- // 配置 Nuxt.js 应用是开发模式还是生产模式
- dev: process.env.NODE_ENV !== 'production',
- // 配置在客户端和服务端共享的环境变量
- env: {
- ...process.env,
- },
- server: {
- port: process.env.PORT,
- host: process.env.HOST,
- https:
- process.env.HTTPS === 'true'
- ? {
- key: fs.readFileSync(path.join(__dirname, 'cert.key')),
- cert: fs.readFileSync(path.join(__dirname, 'cert.crt')),
- }
- : null,
- },
- log: {
- level: 'debug'
- }
- }
|