mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-04 14:10:38 +08:00

* chore(webpack): file-loader is added for font * chore(UI): monaco-editor is added * feat(UI): Editor component is added * feat(UI): List All Alerts is updated * feat(UI): Create Alert is updated * feat(API): create alert api is added * feat(page): EditRules is added * feat(UI): Alerts WIP * chore(typescript): typing are updated * update(UI): useFetch hook is updated * chore(UI): component for alerts is updated * chore(UI): create alert is updated * feat(UI): delete alert is now added * feat(api): Delete api is added * chore(route): edit rule route is updated * update(UI): get getAll put Alert functionality is added * update(UI): Alert Channels is updated in setting tab * chore(UI): alerts api is updated * chore(UI): getGroup api is updated * chore(UI): chprev api is updated * chore(UI): getGroup interface is exportable * feat(UI):Alerts is added * temp * feat(UI): triggered alerts is added * chore(UI): deafault key for the alert is updated * chore(UI): alerts linting is fixed * chore(UI): alerts linting is fixed * chore(UI): sort order is implemented * feat(FE): channels WIP * feat(UI): slack ui is updated * Channels is updated * feat(UI): slack ui is updated * fix(ROUTES): Channels have a seperate route * fix(build): production build is fixed by adding the file loader * fix(UI): create slack config is updated * fix(BUG): delete alert rule is fixed * fix(bug): after successfull edit user is navigated to all rules * fix(bug): alert is updated * fix(bug): expandable row is updated * fix(bug): filter and grouping of the alerts is fixed * chore(alerts): default title and description of the channels is updated * fix(UI): filtering is fixed * fix(UI): baseUrl is redirected to the nginx and text is updated * fix(BUG): destoryed the inactive pane * chore(UI): placeholder for the triggered alerts is updated * chore(FE): placeholder is updated * chore(UI): placeholder is updated for the create alert
78 lines
1.9 KiB
TypeScript
78 lines
1.9 KiB
TypeScript
// shared config (dev and prod)
|
|
import CompressionPlugin from 'compression-webpack-plugin';
|
|
import CopyPlugin from 'copy-webpack-plugin';
|
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
import { resolve } from 'path';
|
|
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
|
|
import webpack, { WebpackPluginInstance } from 'webpack';
|
|
|
|
const __dirname = resolve();
|
|
|
|
const config: webpack.Configuration = {
|
|
mode: 'production',
|
|
devtool: 'source-map',
|
|
entry: resolve(__dirname, './src/index.tsx'),
|
|
output: {
|
|
filename: ({ chunk }): string => {
|
|
const hash = chunk?.hash;
|
|
const name = chunk?.name;
|
|
return `js/${name}-${hash}.js`;
|
|
},
|
|
path: resolve(__dirname, './build'),
|
|
publicPath: '/',
|
|
},
|
|
|
|
resolve: {
|
|
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
|
plugins: [new TsconfigPathsPlugin({})],
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: [/\.jsx?$/, /\.tsx?$/],
|
|
use: ['babel-loader'],
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader'],
|
|
},
|
|
{
|
|
test: /\.(scss|sass)$/,
|
|
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
},
|
|
{
|
|
test: /\.(jpe?g|png|gif|svg)$/i,
|
|
use: [
|
|
'file-loader?hash=sha512&digest=hex&name=img/[chunkhash].[ext]',
|
|
'image-webpack-loader?bypassOnDebug&optipng.optimizationLevel=7&gifsicle.interlaced=false',
|
|
],
|
|
},
|
|
{
|
|
test: /\.(ttf|eot|woff|woff2)$/,
|
|
use: ['file-loader'],
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({ template: 'src/index.html.ejs' }),
|
|
(new CompressionPlugin({
|
|
exclude: /.map$/,
|
|
}) as unknown) as WebpackPluginInstance,
|
|
(new CopyPlugin({
|
|
patterns: [{ from: resolve(__dirname, 'public/'), to: '.' }],
|
|
}) as unknown) as WebpackPluginInstance,
|
|
new webpack.ProvidePlugin({
|
|
process: 'process/browser',
|
|
}),
|
|
new webpack.DefinePlugin({
|
|
'process.env': JSON.stringify(process.env),
|
|
}),
|
|
],
|
|
performance: {
|
|
hints: false,
|
|
},
|
|
};
|
|
|
|
export default config;
|