zoukankan      html  css  js  c++  java
  • vuecli/3.0 vue.config.js

    const path = require('path')
    const debug = process.env.NODE_ENV !== 'production'

    module.exports = {
    baseUrl: '/', // 根域上下文目录
    outputDir: 'dist', // 构建输出目录
    assetsDir: 'assets', // 静态资源目录 (js, css, img, fonts)
    lintOnSave: false, // 是否开启eslint保存检测,有效值:ture | false | 'error'
    runtimeCompiler: true, // 运行时版本是否需要编译
    transpileDependencies: [], // 默认babel-loader忽略mode_modules,这里可增加例外的依赖包名
    productionSourceMap: true, // 是否在构建生产包时生成 sourceMap 文件,false将提高构建速度
    configureWebpack: config => { // webpack配置,值位对象时会合并配置,为方法时会改写配置
    if (debug) { // 开发环境配置
    config.devtool = 'cheap-module-eval-source-map'
    } else { // 生产环境配置
    }
    // Object.assign(config, { // 开发生产共同配置
    // resolve: {
    // alias: {
    // '@': path.resolve(__dirname, './src'),
    // '@c': path.resolve(__dirname, './src/components'),
    // 'vue$': 'vue/dist/vue.esm.js'
    // }
    // }
    // })
    },
    chainWebpack: config => { // webpack链接API,用于生成和修改webapck配置,https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
    if (debug) {
    // 本地开发配置
    } else {
    // 生产开发配置
    }
    },
    parallel: require('os').cpus().length > 1, // 构建时开启多进程处理babel编译
    pluginOptions: { // 第三方插件配置
    },
    pwa: { // 单页插件相关配置 https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa
    },
    devServer: {
    open: true,
    host: 'localhost',
    port: 8080,
    https: false,
    hotOnly: false,
    proxy: { // 配置跨域
    '/api': {
    target: 'http://localhost:5001/api/',
    ws: true,
    changOrigin: true,
    pathRewrite: {
    '^/api': ''
    }
    }
    },
    before: app => { }
    }
    }
  • 相关阅读:
    C语言中字符串常用函数--strcat,strcpy
    linux下core dump【总结】
    C语言memset()函数:将内存的前n个字节设置为特定的值
    const的理解、const指针、指向const的指针
    C99标准的新特性
    ISO C语言新标准(C11)
    哪个版本的gcc才支持c11
    不使用session,借助redis实现验证码
    google浏览器截图工具 Open Screenshot(代码截图)
    springmvc+jpa实现分页的两种方式
  • 原文地址:https://www.cnblogs.com/binglove/p/10959759.html
Copyright © 2011-2022 走看看