vue-cli开发配置认识

本文探讨了vue-cli的开发配置,包括git钩子的设置,详细解释了如何配置package.json以使更改生效,并提到了babel.config.js中的Babel配置。此外,还提及了项目的默认配置位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

git钩子的一些配置

在这里插入图片描述

相关链接介绍

  • 生效package.json配置
"gitHooks": {
   "pre-commit": "npm run lint"
   ...xxx
},
  • 有兴趣的可以去了解一下 yorkie 这个包

babel配置

  • 在bable.config.js里面
module.exports = {
  presets: [
    '@vue/app'
  ]
}

项目默认配置

  • 所在位置为

在这里插入图片描述

exports.defaults = () => ({
  // project deployment base
  publicPath: '/',
  // for compatibility concern. TODO: remove in v4.
  baseUrl: '/',

  // where to output built files
  outputDir: 'dist',

  // where to put static assets (js/css/img/font/...)
  assetsDir: '',

  // filename for index.html (relative to outputDir)
  indexPath: 'index.html',

  // whether filename will contain hash part
  filenameHashing: true,

  // boolean, use full build?
  runtimeCompiler: false,

  // deps to transpile
  transpileDependencies: [/* string or regex */],

  // sourceMap for production build?
  productionSourceMap: !process.env.VUE_CLI_TEST,

  // use thread-loader for babel & TS in production build
  // enabled by default if the machine has more than 1 cores
  parallel: hasMultipleCores(),

  // multi-page config
  pages: undefined,

  // <script type="module" crossorigin="use-credentials">
  // #1656, #1867, #2025
  crossorigin: undefined,

  // subresource integrity
  integrity: false,

  css: {
    // extract: true,
    // modules: false,
    // localIdentName: '[name]_[local]_[hash:base64:5]',
    // sourceMap: false,
    // loaderOptions: {}
  },

  // whether to use eslint-loader
  lintOnSave: true,

  devServer: {
  /*
    open: process.platform === 'darwin',
    host: '0.0.0.0',
    port: 8080,
    https: false,
    hotOnly: false,
    proxy: null, // string | Object
    before: app => {}
  */
  }
})

thanks

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值