Skip to content

Commit

Permalink
修改配置
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jul 20, 2021
1 parent 3cee1fe commit 615f200
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Browsers that we support

last 2 versions
> 1%
iOS 7
last 3 iOS versions
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ module.exports = {
SwitchCase: 1,
},
],
tabWidth: 4,
},
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@
"prettier": "^2.3.2",
"sass": "^1.35.2",
"vite": "^2.4.2"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
2 changes: 1 addition & 1 deletion prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
printWidth: 80,
tabWidth: 2,
tabWidth: 4,
useTabs: false,
singleQuote: true,
semi: false,
Expand Down
41 changes: 32 additions & 9 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,37 @@ import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
alias: {
components: resolve(__dirname, 'src/components'),
accets: resolve(__dirname, 'src/accets'),
views: resolve(__dirname, 'src/views'),
router: resolve(__dirname, 'src/router'),
utils: resolve(__dirname, 'src/utils'),
apis: resolve(__dirname, 'src/apis'),
styles: resolve(__dirname, 'src/styles'),
},
base: './',
plugins: [vue()],
resolve: {
alias: {
components: resolve(__dirname, 'src/components'),
accets: resolve(__dirname, 'src/accets'),
views: resolve(__dirname, 'src/views'),
router: resolve(__dirname, 'src/router'),
utils: resolve(__dirname, 'src/utils'),
apis: resolve(__dirname, 'src/apis'),
styles: resolve(__dirname, 'src/styles'),
}
},
// 引入全局scss文件
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "./src/styles/variables";'
}
}
},
build: {
terserOptions: {
//生产环境移除console
compress: {
drop_console: true,
},
},
// 取消计算文件大小,加快打包速度
brotliSize: false,
sourcemap: true,
rollupOptions: {}
}
})

0 comments on commit 615f200

Please sign in to comment.