From efc336e60cf1331bf5f3213d296981b87b8b2a6c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 4 Jun 2023 19:24:05 +0300 Subject: =?UTF-8?q?fixes=20#3537=20(Telegram:=2032-=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D1=80=D1=8F=D0=B4=D0=BD=D0=B0=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=B0=D0=B4=D0=B0=D0=B5=D1=82=20=D0=B2=20?= =?UTF-8?q?64-=D1=80=D0=B0=D0=B7=D1=80=D1=8F=D0=B4=D0=BD=D0=BE=D0=B9=20Win?= =?UTF-8?q?dows)=20+=20update=20to=20the=20fresh=20TDLIB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tdlib/td/example/web/tdweb/webpack.config.js | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 protocols/Telegram/tdlib/td/example/web/tdweb/webpack.config.js (limited to 'protocols/Telegram/tdlib/td/example/web/tdweb/webpack.config.js') diff --git a/protocols/Telegram/tdlib/td/example/web/tdweb/webpack.config.js b/protocols/Telegram/tdlib/td/example/web/tdweb/webpack.config.js new file mode 100644 index 0000000000..67c7a3eebe --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/web/tdweb/webpack.config.js @@ -0,0 +1,86 @@ +const path = require('path'); +const CleanWebpackPlugin = require('clean-webpack-plugin'); + +module.exports = { + entry: ['./src/index.js'], + output: { + filename: 'tdweb.js', + path: path.resolve(__dirname, 'dist'), + library: 'tdweb', + libraryTarget: 'umd', + umdNamedDefine: true, + globalObject: 'this' + }, + devServer: { + contentBase: './dist' + }, + plugins: [ + // new HtmlWebpackPlugin(), + new CleanWebpackPlugin({}) + //, new UglifyJSPlugin() + ], + optimization:{ + minimize: false, // <---- disables uglify. + }, + module: { + noParse: /td_asmjs\.js$/, + rules: [ + { + test: /\.(js|jsx)$/, + exclude: /prebuilt/, + enforce: 'pre', + include: [path.resolve(__dirname, 'src')], + use: [ + { + loader: require.resolve('eslint-loader') + } + ] + }, + { + test: /worker\.(js|jsx)$/, + include: [path.resolve(__dirname, 'src')], + use: [ + { + loader: require.resolve('worker-loader') + } + ] + }, + { + test: /\.(js|jsx)$/, + exclude: /prebuilt/, + include: [path.resolve(__dirname, 'src')], + use: [ + { + loader: require.resolve('babel-loader') + } + ] + }, + { + test: /\.(wasm|mem)$/, + include: [path.resolve(__dirname, 'src')], + type: "javascript/auto", + use: [ + { + loader: require.resolve('file-loader') + } + ] + } + ] + }, + node: { + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + crypto: 'empty', + child_process: 'empty' + }, + performance: { + maxAssetSize: 30000000 + }, + resolve: { + alias: { + ws$: 'fs' + } + } +}; -- cgit v1.2.3