Initial Commit

Signed-off-by: Pascal Syma <pascal@syma.dev>
This commit is contained in:
2020-10-01 22:19:17 +02:00
commit d6dea5cbf2
19 changed files with 11505 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2020. Pascal Syma <pascal@syma.dev>.
* All rights reserved.
*/
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const {CleanWebpackPlugin} = require("clean-webpack-plugin");
module.exports = {
mode: "development",
devtool: "eval-source-map",
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.(ogg|mp3|wav|mpe?g|gif|png|jpe?g|svg|xml)$/i,
use: "file-loader"
},
{
test: /\.csv$/i,
use: 'raw-loader',
},
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
plugins: [
new CleanWebpackPlugin({
root: path.resolve(__dirname, "../")
}),
new HtmlWebpackPlugin({
template: "./index.html"
})
]
};
+66
View File
@@ -0,0 +1,66 @@
/*
* Copyright (c) 2020. Pascal Syma <pascal@syma.dev>.
* All rights reserved.
*/
const {merge} = require('webpack-merge');
const path = require("path");
const base = require("./base");
const TerserPlugin = require("terser-webpack-plugin");
const WorkboxPlugin = require('workbox-webpack-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
module.exports = merge(base, {
mode: "production",
output: {
filename: "bundle.min.js"
},
devtool: false,
performance: {
maxEntrypointSize: 900000,
maxAssetSize: 900000
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
output: {
comments: false
}
}
})
]
},
plugins: [
new WorkboxPlugin.GenerateSW({
clientsClaim: true,
skipWaiting: true,
}),
new FaviconsWebpackPlugin({
logo: './map.png',
publicPath: "./",
favicons: {
manifestRelativePaths: true,
start_url: "../",
appName: 'RT Delbus',
appDescription: 'Real-Time Delbus',
appShortName: "rt-delbus",
developerName: 'Syma.Dev',
developerURL: "https://syma.dev",
background: '#000',
theme_color: '#333',
logging: false,
icons: {
android: true,
appleIcon: true,
appleStartup: false,
coast: false,
favicons: true,
firefox: true,
windows: true,
yandex: false
}
}
})
]
});