| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- const path = require('path')
- function resolve(dir) {
- return path.join(__dirname, dir)
- }
- const name = 'HerTube'
- module.exports = {
- productionSourceMap: false,
- // options...
- devServer: {
- port: 8080,
- // TODO 部署到 nginx 中后,使用 rewrite 指令配置
- proxy: {
- // 静态资源地址
- '/tnb': {
- target: process.env.VUE_APP_BASE_API,
- changeOrigin: true,
- ws: true,
- pathRewrite: {
- '^/tnb': '/tnb'
- }
- },
- // 弹幕接口
- '/api': {
- target: process.env.VUE_APP_BASE_API,
- changeOrigin: true,
- ws: true,
- pathRewrite: {
- '^/api': '/api'
- }
- }
- }
- },
- configureWebpack: {
- // provide the app's title in webpack's name field, so that
- // it can be accessed in index.html to inject the correct title.
- name: name,
- resolve: {
- alias: {
- '@': resolve('src')
- }
- }
- }
- }
|