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
- Please pick a preset (Please choose configuration mode) :default(default configuration), Manually select features (manual selection); I chose manual selection here
- 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
- Use history mode for router? (Requires proper server setup for index fallback in production) Yes Requires proper server setup for index fallback in production
- 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)
- Pick a linter/formatter config (select esLint syntax check mode) : here I choose Standard (Standard)
- Pick Additional Lint features Pick additional Lint features
- 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
- 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