From 65d32aeecbfc1fc1063f30f34e16cccb3647d0a0 Mon Sep 17 00:00:00 2001 From: Andrei Picus Date: Tue, 3 Aug 2021 13:17:18 +0200 Subject: [PATCH] build: Prevent accidental build artifacts --- examples/webpack/tsconfig.build.json | 6 ++++++ examples/webpack/webpack.config.js | 8 +++++++- tsconfig.json | 6 +++++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 examples/webpack/tsconfig.build.json diff --git a/examples/webpack/tsconfig.build.json b/examples/webpack/tsconfig.build.json new file mode 100644 index 00000000..cc5774c0 --- /dev/null +++ b/examples/webpack/tsconfig.build.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false + } +} diff --git a/examples/webpack/webpack.config.js b/examples/webpack/webpack.config.js index 8c7d4520..1a98c4f2 100644 --- a/examples/webpack/webpack.config.js +++ b/examples/webpack/webpack.config.js @@ -12,6 +12,12 @@ module.exports = { plugins: [new TsconfigPathsPlugin()], }, module: { - rules: [{ test: /\.tsx?$/, loader: "ts-loader" }], + rules: [ + { + test: /\.tsx?$/, + loader: "ts-loader", + options: { configFile: "tsconfig.build.json" }, + }, + ], }, }; diff --git a/tsconfig.json b/tsconfig.json index d878c03f..9bdba754 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,10 @@ "paths": { "@nighttrax/components/*": ["packages/components/src/*"], "@nighttrax/*": ["packages/*/src"] - } + }, + /* Avoid littering the projects with build artifacts from accidental + builds e.g. started from the IDE. The build configs should turn + this off. */ + "noEmit": true } }