Vueはvueを構成する.config.js

7305 ワード

//    
const path = require('path');
module.exports = {
     

    configureWebpack: {
     
        resolve: {
     
            alias: {
     
            	//     
                '@': path.join(__dirname, 'src/'),
                '@@': path.join(__dirname, 'src/components/'),
            },
        },
    },
    //     
    devServer: {
     
        proxy: {
     
            '/api': {
     
                target: 'https://blogs.zdldove.top',
                changeOrigin: true,
                ws: true,
                pathRewrite: {
     
                    '^/api': ''
                }
            }
        }
    },

}
 /*              URL:          ,baseUrl   Vue CLI 3.3     ,   publicPath */
    /* baseUrl: process.env.NODE_ENV === 'production' ? './' : '/' */
    publicPath: process.env.NODE_ENV === 'production' ? '/public/' : './',
    /*       : npm run build ,          */
    outputDir: 'dist',
    /*           (js、css、img、fonts)   (    outputDir  )    */
    assetsDir: "assets",
    /*             sourceMap   ,false        */
    productionSourceMap: false,
    /*      ,                   hash          ,             false         。(false               ) */
    filenameHashing: false,
    /*        eslint   */
    lintOnSave: true,
    /* webpack-dev-server      */
    devServer: {
     
        /*         */
        open: true,
        /*    0.0.0.0           */
        host: '0.0.0.0',
        port: 8066,
        https: false,
        hotOnly: false,
        /*      */
        proxy: {
     
            '/api': {
     
                /*           */
                target: 'http://47.100.47.3/',
                /*      */
                changeOrigin: true,
            },
        },
    },