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 .firebase
yarm-error.log yarm-error.log
yarn.lock yarn.lock
package-lock.json

View file

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

View file

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

View file

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

View file

@ -1,7 +1,4 @@
const path = require('path'); 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 = { const PATHS = {
entryPoint: path.resolve(__dirname, 'src/main.ts'), entryPoint: path.resolve(__dirname, 'src/main.ts'),
@ -30,15 +27,18 @@ module.exports = (env, argv) => ({
optimization: { optimization: {
minimize: false, minimize: false,
}, },
plugins: [ plugins: [],
// Cleans the dist folder before the build starts module: {
new CleanWebpackPlugin(), rules: [
// Generate a base html file and injects all generated css and js files {
new HtmlWebpackPlugin(), test: /\.ts$/,
// Multi threading typescript loader configuration with caching for .ts and .tsx files use: {
// see https://github.com/namics/webpack-config-plugins/tree/master/packages/ts-config-webpack-plugin/config loader: 'ts-loader',
new TsConfigWebpackPlugin(), },
], exclude: /node_modules/,
},
],
},
resolve: { resolve: {
extensions: ['.ts'], extensions: ['.ts'],
}, },