Fix build issues

This commit is contained in:
schmelczerandras 2020-10-22 21:49:39 +02:00
parent dd21c20b3a
commit af616042f3
5 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ node_modules
.firebase
yarm-error.log
yarn.lock
package-lock.json

View file

@ -13,6 +13,7 @@ module.exports = (env, argv) => ({
entry: {
main: [PATHS.entryPoint],
},
externals: [
nodeExternals({
allowlist: [/(^shared)/],

View file

@ -53,6 +53,12 @@ module.exports = {
enforce: 'pre',
use: ['source-map-loader'],
},
{
test: /\.svg$/,
use: {
loader: 'file-loader',
},
},
],
},
};

View file

@ -11,6 +11,7 @@
"downlevelIteration": true,
"moduleResolution": "node",
"module": "commonjs",
"skipLibCheck": true,
"composite": true,
"lib": ["dom", "es2017"]
},

View file

@ -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'],
},