To build a

Vue create Project nameThe preceding figure shows the vue3.0 manual configuration items. The meanings of each configuration item are as follows

  1. Please pick a preset (Please choose configuration mode) :default(default configuration), Manually select features (manual selection); I chose manual selection here
  2. Check the features needed for your project Check the features needed for your project (select the dependencies loaded by default) : move the up and down keys here, Check the space, enter the next step
  3. Use history mode for router? (Requires proper server setup for index fallback in production) Yes Requires proper server setup for index fallback in production
  4. Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with Node-sass) (Select CSS language support mode such as CSS/LESS)
  5. Pick a linter/formatter config (select esLint syntax check mode) : here I choose Standard (Standard)
  6. Pick Additional Lint features Pick additional Lint features
  7. Where do you prefer placing config for Babel, ESLint, etc.? (select the location where Babel, esLint, etc rules are saved), here I have chosen to use a separate file
  8. Save this as a preset for future projects? (Here indicates whether to rename the project name)

Configure the vue. Config. Js

module.exports = {
  publicPath: 'Resolve partial static resource fetch failure after package'.publicPath: '/'.outputDir: 'Directory of packaged files'.outputDir: 'D://wd_gzh'.assetsDir: 'Files in outputDir are summarized into a specified file'.assetsDir: 'static'.indexPath: 'The directory where the index.html is packaged and the file name'.indexPath: 'D://wd_gzh/index.html',}Copy the code

Configuration. Eslint. Js

  rules: {
    // allow async-await
    'generator-star-spacing': 'off'.// Spaces before and after the generator function *
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'.// Disable the debugger
    'space-before-function-paren': ['error', {
      'anonymous': 'never'.'named': 'never'.'asyncArrow': 'always'}].// Do you want Spaces before parentheses when defining functions
    'one-var': ['error'.'always'].// continuous declaration
    'no-unused-expressions': 0.// Disallow useless expressions
    'prefer-promise-reject-errors': 0 // disallow promise -> reject An Error is reported when a non-error parameter is passed
  }
Copy the code