2021-07-28 16:15:52 +03:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2021-11-07 12:16:36 +02:00
|
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
2022-04-24 13:12:24 +03:00
|
|
|
const webpack = require('webpack');
|
2021-07-28 16:15:52 +03:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
|
|
|
polyfill: 'babel-polyfill',
|
|
|
|
main: './src/index.jsx'
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.js', '.jsx'],
|
|
|
|
fallback: {
|
|
|
|
'crypto': require.resolve('crypto-browserify'),
|
|
|
|
'path': require.resolve('path-browserify'),
|
|
|
|
'fs': require.resolve('browserify-fs'),
|
|
|
|
'stream': require.resolve('stream-browserify'),
|
|
|
|
'util': require.resolve('util/'),
|
2021-08-17 12:40:44 +03:00
|
|
|
'assert': require.resolve('assert/'),
|
2022-01-27 06:19:52 +02:00
|
|
|
'url': require.resolve('url/'),
|
2022-04-24 13:12:24 +03:00
|
|
|
'buffer': require.resolve('buffer'),
|
2021-07-28 16:15:52 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
node: {
|
|
|
|
global: true,
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.jsx?$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['@babel/preset-env', '@babel/preset-react'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.html$/,
|
|
|
|
use: ['html-loader'],
|
|
|
|
},
|
|
|
|
{
|
2022-03-18 05:37:11 +02:00
|
|
|
test: /\.(png|jpe?g|gif|otf|ttf|woff|woff2|ogg)$/,
|
2021-11-07 12:16:36 +02:00
|
|
|
type: 'asset/resource',
|
2021-07-28 16:15:52 +03:00
|
|
|
},
|
2021-11-07 12:16:36 +02:00
|
|
|
{
|
|
|
|
test: /\.svg$/,
|
|
|
|
type: 'asset/inline',
|
|
|
|
}
|
2021-07-28 16:15:52 +03:00
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({ template: './public/index.html' }),
|
2021-11-07 12:16:36 +02:00
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
|
|
|
{ from: 'olm.wasm' },
|
|
|
|
{ from: '_redirects' },
|
|
|
|
{ from: 'config.json' },
|
2022-09-04 16:53:02 +03:00
|
|
|
{ from: 'public/res/android'}
|
2021-11-07 12:16:36 +02:00
|
|
|
],
|
|
|
|
}),
|
2022-04-24 13:12:24 +03:00
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
Buffer: ['buffer', 'Buffer'],
|
|
|
|
}),
|
2021-07-28 16:15:52 +03:00
|
|
|
],
|
|
|
|
};
|