2021-05-05 20:51:59 +03:00
|
|
|
'use strict';
|
|
|
|
const path = require('path');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
2021-05-29 18:49:45 +03:00
|
|
|
//const WasmPackPlugin = require('@wasm-tool/wasm-pack-plugin');
|
2021-05-05 20:51:59 +03:00
|
|
|
|
|
|
|
module.exports = {
|
2021-11-30 18:27:32 +03:00
|
|
|
//devtool: 'inline-source-map',
|
|
|
|
//mode: 'development',
|
|
|
|
mode: 'production',
|
2021-05-25 18:10:57 +03:00
|
|
|
entry: {
|
2021-05-29 18:49:45 +03:00
|
|
|
bundle: './templates/index.ts',
|
2021-05-25 18:10:57 +03:00
|
|
|
mobile: './templates/mobile.ts',
|
2021-07-06 21:58:32 +03:00
|
|
|
verificationWidget: './templates/widget/js/index.ts',
|
2021-05-25 18:10:57 +03:00
|
|
|
},
|
2021-05-05 20:51:59 +03:00
|
|
|
output: {
|
2021-05-25 18:10:57 +03:00
|
|
|
filename: '[name].js',
|
2021-05-29 09:52:31 +03:00
|
|
|
path: path.resolve(__dirname, './static/cache/bundle/'),
|
2021-05-05 20:51:59 +03:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
loader: 'ts-loader',
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
test: /\.s[ac]ss$/i,
|
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
'css-loader',
|
|
|
|
{
|
|
|
|
loader: 'sass-loader',
|
|
|
|
options: {
|
|
|
|
implementation: require('dart-sass'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.tsx', '.js'],
|
|
|
|
},
|
|
|
|
|
2021-05-29 18:49:45 +03:00
|
|
|
plugins: [
|
|
|
|
new MiniCssExtractPlugin(),
|
2021-07-06 21:58:32 +03:00
|
|
|
// new WasmPackPlugin({
|
|
|
|
// crateDirectory: __dirname,
|
|
|
|
// outName: "pow.wasm",
|
|
|
|
// }),
|
2021-05-29 18:49:45 +03:00
|
|
|
],
|
2021-05-05 20:51:59 +03:00
|
|
|
optimization: {
|
|
|
|
minimizer: [
|
|
|
|
// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
|
|
|
|
`...`,
|
|
|
|
new CssMinimizerPlugin(),
|
|
|
|
],
|
|
|
|
},
|
2021-07-06 21:58:32 +03:00
|
|
|
experiments: {
|
|
|
|
// executeModule: true,
|
|
|
|
// outputModule: true,
|
|
|
|
//syncWebAssembly: true,
|
|
|
|
// topLevelAwait: true,
|
|
|
|
asyncWebAssembly: true,
|
|
|
|
// layers: true,
|
|
|
|
// lazyCompilation: true,
|
|
|
|
},
|
2021-05-05 20:51:59 +03:00
|
|
|
};
|