diff options
Diffstat (limited to 'protocols/Telegram/tdlib/td/example/web/tdweb/webpack.config.js')
-rw-r--r-- | protocols/Telegram/tdlib/td/example/web/tdweb/webpack.config.js | 86 |
1 files changed, 86 insertions, 0 deletions
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' + } + } +}; |