From af616042f3f41ff6b51b5ffdc555935f3422690e Mon Sep 17 00:00:00 2001 From: schmelczerandras Date: Thu, 22 Oct 2020 21:49:39 +0200 Subject: [PATCH] Fix build issues --- .gitignore | 1 + backend/webpack.config.js | 1 + frontend/webpack.config.js | 6 ++++++ shared/tsconfig.json | 1 + shared/webpack.config.js | 24 ++++++++++++------------ 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 6c971d6..082491d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules .firebase yarm-error.log yarn.lock +package-lock.json diff --git a/backend/webpack.config.js b/backend/webpack.config.js index 90ebc97..7dfd8f0 100644 --- a/backend/webpack.config.js +++ b/backend/webpack.config.js @@ -13,6 +13,7 @@ module.exports = (env, argv) => ({ entry: { main: [PATHS.entryPoint], }, + externals: [ nodeExternals({ allowlist: [/(^shared)/], diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 642317d..699beee 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -53,6 +53,12 @@ module.exports = { enforce: 'pre', use: ['source-map-loader'], }, + { + test: /\.svg$/, + use: { + loader: 'file-loader', + }, + }, ], }, }; diff --git a/shared/tsconfig.json b/shared/tsconfig.json index 46fe043..8f87854 100644 --- a/shared/tsconfig.json +++ b/shared/tsconfig.json @@ -11,6 +11,7 @@ "downlevelIteration": true, "moduleResolution": "node", "module": "commonjs", + "skipLibCheck": true, "composite": true, "lib": ["dom", "es2017"] }, diff --git a/shared/webpack.config.js b/shared/webpack.config.js index 20fa930..2eebc06 100644 --- a/shared/webpack.config.js +++ b/shared/webpack.config.js @@ -1,7 +1,4 @@ const path = require('path'); -const CleanWebpackPlugin = require('clean-webpack-plugin').CleanWebpackPlugin; -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const TsConfigWebpackPlugin = require('ts-config-webpack-plugin'); const PATHS = { entryPoint: path.resolve(__dirname, 'src/main.ts'), @@ -30,15 +27,18 @@ module.exports = (env, argv) => ({ optimization: { minimize: false, }, - plugins: [ - // Cleans the dist folder before the build starts - new CleanWebpackPlugin(), - // Generate a base html file and injects all generated css and js files - new HtmlWebpackPlugin(), - // Multi threading typescript loader configuration with caching for .ts and .tsx files - // see https://github.com/namics/webpack-config-plugins/tree/master/packages/ts-config-webpack-plugin/config - new TsConfigWebpackPlugin(), - ], + plugins: [], + module: { + rules: [ + { + test: /\.ts$/, + use: { + loader: 'ts-loader', + }, + exclude: /node_modules/, + }, + ], + }, resolve: { extensions: ['.ts'], },