Skip to content

Commit

Permalink
fix: fix tsconfig
Browse files Browse the repository at this point in the history
Paths in tsconfig are relative to the config fine in which they are declared.
So any path declared in `packages/tsconfig/base.json` is relative to that directory.
This applies in particular to `outDir` and `include`. These have to be redeclared
in each `tsconfig.json` file in each library.
See microsoft/TypeScript#29172
  • Loading branch information
opichon committed Nov 5, 2022
1 parent 70310d1 commit 2e2a25d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 30 deletions.
7 changes: 3 additions & 4 deletions libs/vue-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
".": {
"import": "./dist/DzangolabVueConfig.es.js",
"require": "./dist/DzangolabVueConfig.umd.js"
},
"./dist/DzangolabVueConfig.css": "./dist/style.css"
}
},
"main": "dist//DzangolabVueConfig.umd.js",
"module": "dist//DzangolabVueConfig.es.js",
"types": "./dist/src/index.d.ts",
"types": "./dist/types/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "vite build && vue-tsc --emitDeclarationOnly",
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
"publish": "npm publish --access public",
Expand Down
11 changes: 10 additions & 1 deletion libs/vue-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"extends": "tsconfig/base"
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "tsconfig/base",
"compilerOptions": {
"outDir": "./dist"
},
"include": [
"__test__/**/*",
"vite.config.*",
"src/**/*"
]
}
10 changes: 0 additions & 10 deletions libs/vue-config/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,5 @@ export default defineConfig(({ mode }) => {
},
target: "esnext",
},
plugins: [
vue({
reactivityTransform: true,
}),
],
resolve: {
alias: {
"@/": new URL("./src/", import.meta.url).pathname,
},
},
};
});
19 changes: 4 additions & 15 deletions packages/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"compilerOptions": {
"baseUrl": "./",
"composite": false,
"declaration": true,
"declarationMap": true,
Expand All @@ -19,15 +18,10 @@
"scripthost"
],
"module": "esnext",
"moduleResolution": "nodenext",
"moduleResolution": "node",
"noUnusedLocals": false,
"noUnusedParameters": false,
"outDir": "dist",
"paths": {
"@/*": [
"src/*"
]
},
"outDir": "./dist",
"preserveWatchOutput": true,
"resolveJsonModule": true,
"skipLibCheck": true,
Expand All @@ -37,16 +31,11 @@
"types": [
"vite/client"
],
"useDefineForClassFields": true,
"useDefineForClassFields": true
},
"exclude": [
"dist",
"node_modules"
],
"include": [
"__test__/**/*",
"vite.config.*",
"src/**/*",
"src/**/*.vue"
"src/**/*"
]
}

0 comments on commit 2e2a25d

Please sign in to comment.