diff --git a/client/tsconfig.json b/client/tsconfig.json index 4c022668..31dc2cda 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -16,13 +16,12 @@ "allowSyntheticDefaultImports": true, "esModuleInterop": true, "baseUrl": "./", - "paths": { - "@/js/*": ["./js/*"], - "@/css/*": ["./css/*"], - "@/img/*": ["./img/*"], - "@/components/*": ["./components/*"], - "@/backend/*": ["../src/types/*"] - }, + // "paths": { + // "@/js/*": ["./js/*"], + // "@/css/*": ["./css/*"], + // "@/img/*": ["./img/*"], + // "@/components/*": ["./components/*"], + // }, "jsx": "preserve" } } diff --git a/package.json b/package.json index f63a38c0..1f426c76 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "homepage": "https://thelounge.chat/", "scripts": { - "build": "tsc --resolveJsonModule --esModuleInterop --lib DOM webpack.config.ts && webpack --config webpack.config.js", + "build": "webpack", "coverage": "run-s test:* && nyc --nycrc-path=test/.nycrc-report.json report", "dev": "TS_NODE_PROJECT='./src/tsconfig.json' ts-node index start --dev", "format:prettier": "prettier --write \"**/*.*\"", diff --git a/src/plugins/inputs/ban.ts b/src/plugins/inputs/ban.ts index 35b3076c..53c020d6 100644 --- a/src/plugins/inputs/ban.ts +++ b/src/plugins/inputs/ban.ts @@ -1,6 +1,6 @@ "use strict"; -import Msg from "@src/models/msg"; +import Msg from "../../models/msg"; const commands = ["ban", "unban", "banlist", "kickban"]; diff --git a/src/tsconfig.json b/src/tsconfig.json index 3db82085..ee882caf 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -21,10 +21,6 @@ "outDir": "dist", // "resolveJsonModule": true, "esModuleInterop": true, - "moduleResolution": "node", - "paths": { - "@src/*": ["./*"], - "@client/*": ["../client/*"] - } + "moduleResolution": "node" } } diff --git a/tsconfig.base.json b/tsconfig.base.json index 60c92d23..5db451db9 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,5 +1,9 @@ { "compilerOptions": { + "paths": { + "@src/*": ["src/*"], + "@client/*": ["client/*"] + }, "target": "esnext", "module": "commonjs", "outDir": "dist", @@ -21,7 +25,7 @@ "exclude": ["./node_modules", "./public/*"], "references": [ { - "path": "./src" + "path": "./src," }, { "path": "./client" diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..aa70212e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.base.json", + "files": ["./webpack.config.ts"], + "references": [{"path": "./src/"}, {"path": "./client/"}] +} diff --git a/webpack.config.ts b/webpack.config.ts index a72ca0e1..864aef65 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -100,11 +100,11 @@ const config: webpack.Configuration = { extensions: [".js", ".vue", ".json", ".ts"], // modules: ["node_modules", path.resolve(__dirname, "client")], plugins: [ - new TsconfigPathsPlugin({ - configFile: path.resolve(__dirname, "client/tsconfig.json"), - extensions: [".js", ".vue", ".json", ".ts"], - baseUrl: path.resolve(__dirname, "client"), - }), + // new TsconfigPathsPlugin({ + // configFile: path.resolve(__dirname, "client/tsconfig.json"), + // extensions: [".js", ".vue", ".json", ".ts"], + // baseUrl: path.resolve(__dirname, "client"), + // }), ], }, externals: {