Skip to content

Commit

Permalink
fixbug: 注释无用配置
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxiaosi committed Jan 12, 2022
1 parent 396bb25 commit 24a2563
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions build/vite/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { ServerOptions } from 'vite';
export function createViteServer(): ServerOptions {
const viteServer: ServerOptions = {
// 服务器主机名,如果允许外部访问,可设置为"0.0.0.0"
host: '0.0.0.0',
host: true,
// 服务器端口号
port: 3000,
// 端口已被占用时是否尝试使用下一个可用的端口 true:直接退出,而不是尝试下一个可用端口 false:尝试下一个可用端口
strictPort: false,
// strictPort: false,
// boolean | string 启动项目时自动在浏览器打开应用程序;如果为string,比如"/index.html",会打开http://localhost:3000/index.html
// open: true,
// boolean | CorsOptions 为开发服务器配置 CORS。默认启用并允许任何源,传递一个 选项对象 来调整行为或设为 false 表示禁用。
cors: true,
// cors: true,
// 设置为 true 强制使依赖预构建。
force: true,
// force: false,
// 自定义代理规则
proxy: {
'/api': {
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createVitePlugins } from './build/vite/plugin';
import { createViteResolve } from './build/vite/resolve';
import { createViteBuild } from './build/vite/build';
import { createViteServer } from './build/vite/server';
import { createViteOptimizeDeps } from './build/vite/optimizeDeps';
// import { createViteOptimizeDeps } from './build/vite/optimizeDeps';
import { createViteCSS } from './build/vite/css';

export default (configEnv: ConfigEnv): UserConfig => {
Expand All @@ -30,7 +30,7 @@ export default (configEnv: ConfigEnv): UserConfig => {
// 打包配置
build: createViteBuild(),
// 依赖优化配置
optimizeDeps: createViteOptimizeDeps(),
// optimizeDeps: createViteOptimizeDeps(),
// css预处理配置
css: createViteCSS(),
};
Expand Down

0 comments on commit 24a2563

Please sign in to comment.