提交 08d4e34b 编写于 作者: V vben

chore: config ts-config

上级 ba2415c3
......@@ -9,9 +9,6 @@ VITE_PUBLIC_PATH = /
VITE_PROXY = [["/basic-api","http://localhost:3000"],["/upload","http://localhost:3300/upload"]]
# VITE_PROXY=[["/api","https://vvbin.cn/test"]]
# Delete console
VITE_DROP_CONSOLE = false
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api
......
......@@ -4,9 +4,6 @@ VITE_USE_MOCK = true
# public path
VITE_PUBLIC_PATH = /
# Delete console
VITE_DROP_CONSOLE = true
# Whether to enable gzip or brotli compression
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
......
......@@ -5,9 +5,6 @@ VITE_USE_MOCK = true
# public path
VITE_PUBLIC_PATH = /
# Delete console
VITE_DROP_CONSOLE = true
# Whether to enable gzip or brotli compression
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
......
{
"extends": "@vben/ts-config/node.json",
"include": ["src"]
}
{
"extends": "@vben/ts-config/node.json",
"include": ["src"]
}
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Base",
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"strict": true,
"declaration": true,
"noImplicitOverride": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"useUnknownInCatchVariables": false,
"composite": false,
"declarationMap": false,
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"skipLibCheck": true,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"removeComments": true
},
"exclude": ["**/node_modules/**", "**/dist/**"]
}
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node Config",
"extends": "./base.json",
"compilerOptions": {
"lib": ["ESNext"],
"types": ["vite/client"],
"noImplicitAny": true,
"sourceMap": true,
"noEmit": true
}
}
......@@ -3,5 +3,10 @@
"version": "1.0.0",
"private": true,
"license": "MIT",
"files": [
"base.json",
"node.json",
"vue.json"
],
"devDependencies": {}
}
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Vue Library",
"extends": "./base.json",
"compilerOptions": {
"jsx": "preserve",
"lib": ["ESNext", "DOM"],
"noImplicitAny": false
}
}
此差异已折叠。
{
"extends": "@vben/ts-config/vue.json",
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"noLib": false,
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"strictFunctionTypes": false,
"jsx": "preserve",
"baseUrl": ".",
"allowJs": true,
"sourceMap": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"experimentalDecorators": true,
"lib": ["dom", "esnext"],
"noImplicitAny": false,
"skipLibCheck": true,
"baseUrl": "./",
"types": ["vite/client"],
"removeComments": true,
"paths": {
"/@/*": ["src/*"],
"/#/*": ["types/*"]
......
......@@ -63,7 +63,6 @@ declare global {
VITE_GLOB_APP_TITLE: string;
VITE_GLOB_APP_SHORT_NAME: string;
VITE_USE_CDN: boolean;
VITE_DROP_CONSOLE: boolean;
VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean;
}
......
......@@ -27,7 +27,7 @@ export default async ({ command, mode }: ConfigEnv): Promise<UserConfig> => {
// The boolean type read by loadEnv is a string. This function can be converted to boolean type
const viteEnv = wrapperEnv(env);
const { VITE_PUBLIC_PATH, VITE_PROXY, VITE_DROP_CONSOLE } = viteEnv;
const { VITE_PUBLIC_PATH, VITE_PROXY } = viteEnv;
const isBuild = command === 'build';
......@@ -58,24 +58,12 @@ export default async ({ command, mode }: ConfigEnv): Promise<UserConfig> => {
proxy: createProxy(VITE_PROXY),
},
esbuild: {
drop: VITE_DROP_CONSOLE ? ['console', 'debugger'] : [],
drop: ['console', 'debugger'],
},
build: {
target: 'es2015',
cssTarget: 'chrome80',
outDir: OUTPUT_DIR,
// minify: 'terser',
/**
* 当 minify=“minify:'terser'” 解开注释
* Uncomment when minify="minify:'terser'"
*/
// terserOptions: {
// compress: {
// keep_infinity: true,
// drop_console: VITE_DROP_CONSOLE,
// },
// },
// Turning off brotliSize display can slightly reduce packaging time
reportCompressedSize: false,
chunkSizeWarningLimit: 2000,
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册