mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
chore: standardize tsconfig (#9568)
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": false,
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"noEmit": true,
|
||||
"composite": false
|
||||
"rootDir": ".",
|
||||
"outDir": "./dist",
|
||||
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
|
||||
},
|
||||
"include": ["./apps", "./examples"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
"references": [
|
||||
{ "path": "../affine/components" },
|
||||
{ "path": "../affine/model" },
|
||||
{ "path": "../framework/block-std" },
|
||||
{ "path": "../blocks" },
|
||||
{ "path": "../affine/data-view" },
|
||||
{ "path": "../framework/global" },
|
||||
{ "path": "../framework/inline" },
|
||||
{ "path": "../presets" },
|
||||
{ "path": "../framework/store" },
|
||||
{ "path": "../framework/sync" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"allowSyntheticDefaultImports": true
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noUncheckedIndexedAccess": false,
|
||||
"rootDir": ".",
|
||||
"outDir": "./lib",
|
||||
"tsBuildInfoFile": "./lib/tsconfig.tsbuildinfo"
|
||||
},
|
||||
"include": ["vite.config.ts", "./scripts"]
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ export function sourcemapExclude(): Plugin {
|
||||
map: { mappings: '' },
|
||||
};
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -157,10 +159,10 @@ const clearSiteDataPlugin = () =>
|
||||
}) as Plugin;
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default ({ mode }) => {
|
||||
export default defineConfig(({ mode }) => {
|
||||
process.env = { ...process.env, ...loadEnv(mode, __dirname, '') };
|
||||
|
||||
return defineConfig({
|
||||
return {
|
||||
envDir: __dirname,
|
||||
define: {
|
||||
'import.meta.env.PLAYGROUND_SERVER': JSON.stringify(
|
||||
@@ -200,7 +202,10 @@ export default ({ mode }) => {
|
||||
cache: false,
|
||||
maxParallelFileOps: Math.max(1, cpus().length - 1),
|
||||
onwarn(warning, defaultHandler) {
|
||||
if (['EVAL', 'SOURCEMAP_ERROR'].includes(warning.code)) {
|
||||
if (
|
||||
warning.code &&
|
||||
['EVAL', 'SOURCEMAP_ERROR'].includes(warning.code)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,10 +257,11 @@ export default ({ mode }) => {
|
||||
}
|
||||
return group;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user